question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Controlled input usage

See original GitHub issue

The code below will cause state change loop although it’s regular in React community (Ex. material-ui components)

onChange(value) {
  this.setState({dateValue: value});
}

render() {
  return <DatePicker value={@state.dateValue} onChange={this.onChange.bind(this)} />
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pouriaMalekicommented, Feb 28, 2017

Not very clean solution, but I’ve made a PR.

Thanks dude 😃

0reactions
mohebifarcommented, Feb 28, 2017

You are right. Frankly, I do not use this package anymore, specifically the latest version (v3) which I just did for Evand without myself using it in a real project. I’ll try to investigate on this. I can’t really say when, but probably in this month. Meanwhile, PRs are very welcome 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Controlled Components, the Hooks Way - Dmitri Pavlutin
The controlled components approach can help you access the value of any input type: being regular textual inputs, textareas, select fields. 2.
Read more >
Forms - React
With a controlled component, the input's value is always driven by the React state. While this means you have to type a bit...
Read more >
Controlled and uncontrolled form inputs in React don't have to ...
A controlled input accepts its current value as a prop, as well as a callback to change that value. You could say it's...
Read more >
What is React Controlled Input Components? - eduCBA
In react js control inputs are the input which handles with the help of states and the value of the input captured with...
Read more >
What are controlled and/or uncontrolled inputs in React.js
A controlled is not the only way to access and/or update the value of an input, you can also use the useRef hook...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found