Just a useful tip - you can destructure props in your components so that you can access them directly as variables, instead of always with props.myVariable
For example on your landing page when you're declaring your component like this:
const LandingPage = props => {
You need to access your props like this:
props.setGameData()
You could change that to:
const LandingPage =({ setGameData, userData, setUserData }) => {
So that you can access them like:
setGameData()
It's a small change, but definitely makes things easier for me. It's also nice because you can tell at a glance at your functional component what props you are expecting it to have :)
Just a useful tip - you can destructure props in your components so that you can access them directly as variables, instead of always with
props.myVariable
For example on your landing page when you're declaring your component like this:
const LandingPage = props => {
You need to access your props like this:props.setGameData()
You could change that to:
const LandingPage =({ setGameData, userData, setUserData }) => {
So that you can access them like:setGameData()
It's a small change, but definitely makes things easier for me. It's also nice because you can tell at a glance at your functional component what props you are expecting it to have :)