New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose form values to parent component #7
Conversation
tests/expose-values.js
Outdated
@@ -0,0 +1,43 @@ | |||
//Test things dealing with the initialValues prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialValues => values
tests/expose-values.js
Outdated
error ? <p className="error">{error}</p> : <input {...props} />; | ||
|
||
test('Form passes values to onValues', () => { | ||
const onValues = spy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jest has its own spy, do you just prefer sinon
's implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooo i used it back before i used jest and didnt bother to look and see. maybe ill make a pr where i remove it soon. You're welcome to if you want as well.
README.md
Outdated
|
||
**initialValues** | ||
exposes the values on change, you must manage the form state by passing in values if using this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might say passing in state to the ``values`` prop if using this.
to make it more obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall
@audiolion thoughts? Should be good to go :)