k88hudson / react-formation

Robust, testable forms with react in minutes
https://k88hudson.github.io/react-formation
33 stars 9 forks source link

use getSchema method instead of static schema property #22

Closed eiriklv closed 8 years ago

eiriklv commented 9 years ago

Here's a proposal for how the issue of using props in your schema can be solved.

Refactored the tests and updated the docs/examples (might have missed something though!).

Let me know what you think :-)

eiriklv commented 9 years ago

ref #21

eiriklv commented 9 years ago

And as you'll see I also namespaced the didSubmit and dirtyFields on the state object

Just in case

k88hudson commented 9 years ago

Looks awesome, thanks for doing this :ok_hand:

Would you mind adding a test to CreateForm.test.jsx for getSchema to check to make sure that this.__schema gets created as expected, maybe referencing this.props?

k88hudson commented 9 years ago

Also good call on namespacing

eiriklv commented 9 years ago

Sounds like a good idea - will do that 👍

eiriklv commented 8 years ago

made some really simple tests to check if this.__schema and this.state is set correctly when using this.props in getSchema to set initial values.

@k88hudson - anything else that should be added..?

k88hudson commented 8 years ago

Looks good to me! Many thanks :+1: