I have a variable that stores a dynamic state name and would like to do something like this:
function App() {
const [state, setState] = useState("this is the first state")
var stateName = 'setState'
useEffect(() => {
stateName("updated state")
},[])
return(
<p>{state}<p>
)
}
Is this possible?