Thursday, March 28

Author: Sarah Jorgenson

Web Tricks

Get to Know React's New Context API

In a world where there are lots of different front-end frameworks, it's always hard to know which one to pick. Do I want to use the ever popular Angular? Or would diving into VueJS be beneficial to my scope of knowledge? Then we have ReactJS, a framework created by Facebook that seems to be taking the front-end framework world by storm. Using components, a virtual DOM, and JSX (that's for a different day!), React seems to cover it all, making it a powerful framework. The new Context API was recently introduced in React 16.3 as: A way to pass data through the component tree without having to pass props down manually at every level Sounds great! Let's dig in. Props and State In React, you have props and state. Two very important things to understand. Props, short for properties, is the d...