reacton
reacton copied to clipboard
Accept a function as initial value for use_state
This PR adds the possibility to use a function as inital value for use_state. This is in line with how React works: https://react.dev/reference/react/useState#usestate
When it's costly to calculate the initial value you don't want to rerun it every time the component is rerendered. Therefore, we need to only calculate it once.