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.

It’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:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
WrathChaoscommented, Apr 18, 2021

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 that isChecked prop is your new check state functionality now.

1reaction
WrathChaoscommented, Apr 26, 2021

@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?

Read more comments on GitHub >

github_iconTop 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 >

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