So I started practicing with the useReducer hook in React (which obviously takes a reducer function as its first argument)
My code works fine, but I just realized something: if I define the reducer function inside of the component, my page wont even render, but if I define it OUTSIDE of the component (basically above the component), everything works the way its supposed to
Why is that so? Why can't I define the reducer function within the component as well?