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);