Closed fjuriolli closed 4 years ago
Hey @fjuriolli i am not clear on what you are after in here, can you explain a bit more?
Hey @fjuriolli i am not clear on what you are after in here, can you explain a bit more?
Sure. In my sandbox, I have the an uncontrolled input:
<RHFInput
as={<TextField placeholder="Type your first name" fullWidth={true} />}
style={{ marginBottom: "15px" }}
register={register}
setValue={setValue}
name="firstName"
/>
I need to take the input value and show it on a for example, like this:
<span>This is the value of the input is {inputValue}</span>
you can't use watch
api?
you can't use
watch
api?
Silly me, I just needed to add inputRef={register} to my TextField
Sandbox below: https://codesandbox.io/s/react-79dbg?fontsize=14&hidenavigation=1&theme=dark
The code from sandbox I have a simple uncontrolled form but I need to show the input somewhere else, like this with a controlled form:
What is the most recommended way to do this with a uncontrolled form?