-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncontrolled components #1143
Comments
Hey @GOI17, could you explain a little further on why BigDesign form controls are controlled-only? From our perspective, we let you choose whether you want your inputs to be controlled vs. uncontrolled. I whipped up a little example on how I was able to hook up |
That is my bad. I mentioned that we have had no issues using it as a controlled input and weren't sure if there was an issue the uncontrolled element, maybe it wasn't working? But I'm guessing it could be more related to the implementation inside React Router. |
Retested and they are working fine. I think my problem was that I'm was not use the |
Radio buttons didn't work using them as uncontrolled components, https://codesandbox.io/s/uncontrolled-bigdesign-form-react-router-dom-forked-mhhvfx?file=/src/UncontrolledForm.tsx |
You'll need to add the |
I already tried adding the name prop, I don't know why the sandbox was not updated, but even if I set the prop name I have the same result, on click the form change their value, but the radios are unchecked always "visually" |
I update my original CodeSandbox to show that those inputs are being registered and used correctly: https://codesandbox.io/s/gifted-tree-pmmbir?file=/src/UncontrolledForm.tsx But yeah, it's going to be visually broken, hence #1024. PR's are always welcomed 😉 |
Is your feature request related to a problem? Please describe.
Currently I'm trying to execute an
action
usingForm
component from React Router's v6, that basically under the hood implements the native HTML Form element. It is a simple implementation to use it.Code reference:
Using the native input's to perform that action works, but when I tried to use it with the BigDesign components, I can't use them because they only support the controlled behavior.
Describe the solution, feature, or improvement you'd like
I try to use the styled components to apply to my uncontrolled input but the styles are not exported. So I recreate the input component without the controlled state and is working.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
React router Form
React router Action
The text was updated successfully, but these errors were encountered: