Single Page Applications

Thinking In React

React is a powerful JavaScript framework built around two basic rules: Data flows only one way: From parent to child components (down the component hierarchy) Component restricted scope: A component can only update its own state Being able to build... View Article
Eric Njanga Jan 26, 2018

Reusing code between components in React

Composition Composition in React is the action of using components as building blocks for other components using the techniques of “containment” or “specialization”. Containment Containment is all about creating “empty spots” in a component for any random component to fill.You... View Article
Eric Njanga Dec 29, 2017

Sharing state between two or more components in React

Lifting state up In React, sharing state between components can only be done by moving it up to the closest common ancestor of the components that need it. We call it “lifting state up”. Lifting state involves writing more “boilerplate” code than two-way binding... View Article
Eric Njanga Dec 28, 2017

Controlled Components

A controlled component is a form element whose value or behavior is controlled by React. For example: A form generated by a component whose submission is controlled by React An input text, text-area or select whose value is controlled by React... View Article
Eric Njanga Dec 21, 2017

React Component Lifecycle

Mounting React Refers to a set of methods that are called when an instance of a component is being inserted into the DOM. These methods are: constructor componentWillMount render componentDidMount Unmounting React Refers to the method which is called when... View Article
Eric Njanga Dec 14, 2017