Passing Props with Context

Posted on October 3rd 2020 in React

Passing Props with Context

In most applications properties are passed, from parent to child, so they can be used some levels deeper. This can sometimes seem inconvenient, especially when you have to pass properties to a lot of components. Thanks to React's Context API, this is easy to avoid.…

Read more…

Fragments in React

Posted on September 19th 2020 in React

Fragments in React

React components can only return one element. Often, too often, I see developers who therefore enclose their component in a div. But let me just point out the dangers of this.…

Read more…

React: Don'ts about props

Posted on August 2nd 2020 in React

React: Don'ts about props

In React we use props to pass properties to component. Useful, but you can easily implement them wrong. Below I will discuss two common mistakes.…

Read more…

React: Hooks in functional components

Posted on July 20th 2020 in React

React: Hooks in functional components

As told in a previous post, nowadays you can use Hooks in React, allowing you to use state and lifecycle methods without problems. Read further to know how.…

Read more…

React: Reduce stateful components

Posted on July 4th 2020 in React

React: Reduce stateful components

In a previous blog post I announced that I soon would be posting more best practices to take into account when developing a React app. Today I write about the difference between stateful and stateless components.…

Read more…