RE: From you asking me to do a code review
FYI - I'm not sure how some of these APIs work so forgive me if I don't realize something I did this at a quick glance.
For file: client/src/components/App.jsx
Consider updating to the functional API (react hooks) instead of the component lifecycle (since react is moving away from componentDidMout etc).
You could use the context API to manage the state of API calls and have components watch for updates then render on an update.
For API calls if you'd like to clean up some of the code I'd refactor to async / await so it would be more legible. Idk if I wrote this right but I think it gets the idea across.
const getWeather = async () => {
try {
let getInitData = await fetch('api-endpoint)
let res = await getInitData.json()
let getWeatherData = await fetch('api-endoint/${lat}/${long}'
let weather = await getWeatherData.json()
} catch (err) {
throw error
}
}
For file: client/src/lib/index.js
the big conditional could be a switch statement or could be cleaned up a bit.
For your functions, I would consider using const instead of let because it will throw an error if this application got large and you overwrote/used the same name. I think it's a better practice to use const on functions.
RE: From you asking me to do a code review FYI - I'm not sure how some of these APIs work so forgive me if I don't realize something I did this at a quick glance.
For file: client/src/components/App.jsx
Consider updating to the functional API (react hooks) instead of the component lifecycle (since react is moving away from componentDidMout etc).
For API calls if you'd like to clean up some of the code I'd refactor to async / await so it would be more legible. Idk if I wrote this right but I think it gets the idea across.
For file: client/src/lib/index.js
For your functions, I would consider using const instead of let because it will throw an error if this application got large and you overwrote/used the same name. I think it's a better practice to use const on functions.