Created
April 30, 2015 10:40
-
-
Save devishot/f26e5ebead6d2d28daab to your computer and use it in GitHub Desktop.
React Ideas: 1. common Form with custom buttons via React's childs; 2. get inside functions of Component as specials functions in props that Component should call them on didMount
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
__________________________________________________________ | |
onAccept(value) { | |
to do smth with value | |
} | |
this.getValue = answerFunc | |
( | |
<ApplicationForm data={_data} handler={[['text', handler]]} getMeYourGetValueFunc={saveGetValueFunc}> | |
<Buttons> | |
<FormInput type='button' name='accept' onClick={this.onAccept} /> | |
</Buttons> | |
</ApplicationForm> | |
) | |
FormInput = | |
myGetValue() { | |
this.context.form, | |
this.getValue, | |
} | |
render() { | |
( | |
<input onClick={this.props.onClick.bind(null, this.myGetValue)} | |
) | |
} | |
__________________________________________________________ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment