Consider this code:
const Person = () => {
const [isEmployee, setIsEmployee] = useState(false)
return <>
<Check
placeholder="Is employee?"
change={value => setIsEmployee(value)}
/>
{
isEmployee &&
<>
<Text property="RecruitmentCode" />
<Date property="RecruitmentDate" />
</>
}
</>
}
const Inputs = <>
<Person />
<Text property="Task" />
</>
const TaskForm = <DialogForm
inputs={inputs}
/>
const DialogForm = ({ inputs }) => {
// How can I know inputs are changed here?
}
How can I detect changes in the inputs prop, in the DialogForm? JSON.stringify did not work for me.
I want to detect when the value of isEmployee
in Person
changes in DialogForm