I've got a variable whose initial value I want to be null, but I want to be able to set it as a number as well.
const [intervalId, setIntervalId] = useState(null);
When I write setIntervalId(2); in my code later, it complains that argument type number is not assignable to SetActionState<null>.
What's the proper way to define such a variable in React?