Whenever working with a React functional component, always keep the first letter of the name of the component in Uppercase in order to avoid these React Hooks errors.
In your case, you have named the component app, which should be changed to App, as I said above, to avoid the React Hook error.