An example would be a close button, where it’s primary goal is to close an overlay but it could be used in other cases maybe like a popup and so you don’t want to restrict it to be a parent … Continue reading

Using context allows access of certain data within all components inside the “provider” without having to pass them as props to the children. First create the context: Then make the provider: Here, we import the context, and set up the … Continue reading

This allows you to put children elements directly in the output:

Here’s an example: When updating you need to use “…[object name]” so the other value(s) stay in tact.

Well, a lot has changed since my last post on Pokemon Go. I currently have over 200 million experience which is 10 times what you need to get to level 40. More importantly though, they added level 50 to the … Continue reading

If the file is local (eg. the file config/updates.json below): you can just import it: The constant ‘updatesData’ would give you a list of the data. You can put it as a prop in a component, map through it etc: … Continue reading

This is a copy of this post, but using a function component and hooks.

If you do: You’ll get an error saying “this.setState is not a function”. To fix it for a class function, put it in a function (in this case handleClick() ), bind it in the constructor and use an arrow function … Continue reading