controlled input
See original GitHub issueIt’s better if we get the checked
status from props
instead of state
.
I have a Checkbox
that updates to checked or unchecked when certain conditions (coming from the backend) are met, but I can’t do that with this library.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Forms - React
An input form element whose value is controlled by React in this way is called a “controlled component”. For example, if we want...
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 >React Controlled Components, the Hooks Way - Dmitri Pavlutin
The controlled component is a convenient technique to access the value of input fields in React. It doesn't use references and serves as...
Read more >Controlled and uncontrolled inputs · React in patterns - GitBook
These two terms controlled and uncontrolled are very often used in the context of forms management. controlled input is an input that gets...
Read more >What are controlled inputs with React? - Educative.io
The official documentation defines controlled inputs as: The React component that renders an element also controls what happens in that element on subsequent ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @aprilmintacpineda
I believe that you can make it happen with the new version. Please check it out:
Release 2.1.0 🥳
Documentation
You need to use
disableBuiltInState
prop and you need to make sure thatisChecked
prop is your new check state functionality now.@aprilmintacpineda Awesome explanation! Actually, I really want to put it in the library’s
onPress
passing however there can be some scenarios in which the dev wants to handle it on its own. However, yes doc is misleading I will update it.Also, If the devs want the control the
check
state, there should be a specific workaround solution for themselves.Edit: Updated Doc Do you think is this enough?