What’s the “react” way to trigger a modal when a button is clicked? If you come from Angular, jQuery, or even just vanilla JS, your thought process for opening a modal dialog probably goes something like this:
Hello and welcome! A few days ago React 16.3 was released and alongside other things it also delivered a new React context API. The scope of this tutorial it will be to see in action this new React context API.
The famous 80–20 Pareto principle is also true when it comes to the learning React & ES6 relationship. ES6 came with more that 75 new features, but from what I’ve seen, I found myself needing less than 20% of them in more that 80% of the cases.
We will see in this final part of the series how to use React with setInterval to generate a basic animation and also how to end the running of a setInterval.
In the second part of this tutorial we will see in action things like how to change the state of a component, will add images to our game and "teach" it how to draw some random symbols.
In this first part we will cover the basic project setup, meet the core components and use the inline styles to implement some of the features in our small game example.