How to build a controlled and uncontrolled Input component in React at the same time?

Viewed 88

I am trying to build a component that can either be used controlled or uncontrolled. Similar to how TextField in MaterialUI or Input in ChakraUI. So the component works with or without the value props. What is the best way to build this kind of component?

0 Answers
Related