Created
January 19, 2017 16:08
-
-
Save richardpeng/d814eea83b5908a8501c5362fadc6541 to your computer and use it in GitHub Desktop.
React Stateless Functional Button Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Button from './Button'; | |
const Widget = ( props ) => <div> | |
<Button disabled={props.disabled} onClick={props.reset}>Clear Data</Button> | |
<Button type="submit" disabled={props.submitting}>Get Results</Button> | |
</div>; | |
export default Widget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var filterKeys = function ( targetObject, filterObject ) { | |
var result = Object.assign( {}, targetObject ); | |
for ( var key in filterObject ) { | |
if ( filterObject.hasOwnProperty( key ) ) { | |
delete result[ key ]; | |
} | |
} | |
return result; | |
}; | |
module.exports = filterKeys; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment