One rule
Put state where it can survive as long as the user expects it to survive.
A dropdown can live in the UI. A logged-in user's tasks need the backend or database. A filter you want to share should live in the URL.
What state means
State is any value your app remembers while it runs. It can be a form input, a selected tab, a logged-in user, a cart, a task list, or an API result.
In a weekend project, unclear state causes messy code fast. You pass props everywhere, duplicate data, and lose work on refresh.