Created
October 10, 2025 02:44
-
-
Save jaySmilet/ae5e137f490106a6b2c2a9843f4a6806 to your computer and use it in GitHub Desktop.
Reusable components with controlled and uncontrolled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function CustomInput({ value, onChange, defaultValue }) { | |
| const inputRef = useRef(); | |
| return ( | |
| <input | |
| value={value} | |
| onChange={onChange} | |
| ref={inputRef} | |
| defaultValue={defaultValue} | |
| /> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment