Skip to content

Instantly share code, notes, and snippets.

@devishot
Created April 30, 2015 10:40
Show Gist options
  • Save devishot/f26e5ebead6d2d28daab to your computer and use it in GitHub Desktop.
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
__________________________________________________________
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