Say I have the following code:
const ReactFunction = ({...props}) => {
useEffect(() => { props.function(props.value) }, [props.value])
return <input value={props.value} onChange={props.onChange} />
}
const ReactFunctionWrapper = () => {
const [value, setValue] = setState(0)
const logger = (e) => {console.log(e}
return <ReactFunction onChange={setValue} value={value} function={function} />
}
Should the function() prop be in the dependencyArray of the useEffect as well even though it's a function and should never change?
What exactly should be going into the dependency array?