Answer the question
In order to leave comments, you need to log in
How to test a generic Input component?
I am writing a React web application. Moved the text input field into a separate component Input
. When it is needed, I pass the state and the state setter in the props.
I am writing a unit test for Input
. I don't understand what to do with setValue
, because my state is outside the component. Help me please.
Code in the online sandbox
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question