-
Notifications
You must be signed in to change notification settings - Fork 529
Stop keeping value in state #65
Stop keeping value in state #65
Conversation
+1 |
1 similar comment
+1 |
+1 - any timeline on when this change might occur, realizing this would require a version bump? |
Looks like @sprjr has been accepting PRs lately. Perhaps he can evaluate whether or not this change aligns with the 1.0 API. |
@CMTegner sure thing - do you want to rebase this branch and we can take a look at it? |
4926a24
to
58aa311
Compare
@sprjr: Rebased and ready to review/discuss :) |
I like it. Since this was said I'd like to see if @ryanflorence can take a look as well. I'm otherwise ok with merging it in and releasing a breaking version soon. I'd like to get out of the |
Sounds good to me! I know @ryanflorence has some ideas regarding how the API would change before 1.0. I'd be happy to chip in if help is needed. |
Can we get an update on this? |
@NerdHerd91 I pinged Ryan again to see if he can weigh in (since he had originally asked for things like this. That being said, I'd love to get a bit of progress on this as well - especially now that #77 has been opened. Would love it if we could review that and get it merged in soon so we can follow up on others of these too with a bit more confidence. |
@CMTegner lets plan to move forward on this. We have tests merged in now. Want to rebase off master and verify they are still working (and/or update them)? |
a.k.a. replace `props.initialValue` with `props.value`. This change makes the behaviour of Autocomplete closer to that of native input elements, i.e. you are forced to always supply the current value which the input should display, and the element will provide the updated value via the `onChange` callback (and `onSelect`). Upgrade path: Before: ```js class MyWidget extends Component { render() { return ( <Autocomplete initialValue="hello" /> ) } } ``` After: ```js class MyWidget extends Component { constructor() { this.state = { value: 'hello' } } render() { return ( <Autocomplete value={this.state.value} onChange={event => this.setState({ value: event.target.value })} onSelect={value => this.setState({ value })} /> ) } } ``` This is obviously a breaking change. Closes reactjs#49
58aa311
to
0b8e2d2
Compare
@sprjr done! |
I pushed and release |
Great! 👍 |
a.k.a. replace
props.initialValue
withprops.value
. This change makes thebehaviour of Autocomplete closer to that of native input elements, i.e. you are
forced to always supply the current value which the input should display, and
the element will provide the updated value via the
onChange
callback (andonSelect
).Upgrade path:
Before:
After:
This is obviously a breaking change.
Closes #49