79652166

Date: 2025-06-04 05:43:07
Score: 1
Natty:
Report link

In your interface you created: string | null, and the function typescript definition.

So, there is no need to create the function definition, you just need to set de type of value on the state.

As you can see on the documentation.

https://react.dev/learn/typescript

const [enabled, setEnabled] = useState<boolean>(false);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Tiago Marques