defaultProps
on functional components will eventually be deprecated (as per Dan Abramov, one of the core team), so for future-proofing it’s worth using default parameters.
More Related Contents:
- setState doesn’t update the state immediately
- How to update nested state properties in React
- Unable to access React instance (this) inside event handler [duplicate]
- Adding script tag to React/JSX
- How to scroll to an element?
- When to use ES6 class based React components vs. functional ES6 React components?
- Why and when do we need to bind functions and eventHandlers in React?
- What does three dots do in ReactJS [duplicate]
- How to add multiple classes to a ReactJS Component?
- React useState hook event handler using initial state
- Can I use arrow function in constructor of a react component?
- When should I use brackets with imports
- ES6 array map doesn’t return anything: ReactJS
- setState() inside of componentDidUpdate()
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- Why React Hook useState uses const and not let
- where is create-react-app webpack config and files?
- Unable to use Arrow functions inside React component class [duplicate]
- Best way to polyfill ES6 features in React app that uses create-react-app
- Importing multiple files in react
- React.createClass vs. ES6 arrow function
- How do you import a javascript package from a cdn/script tag in React?
- React.js ES6 avoid binding ‘this’ to every method
- Error: How to serialize data from getStaticProps : Next.js
- What do curly braces mean in JSX (React)?
- Update one of the objects in array, in an immutable way
- How to namespace es6 classes (for React components)
- Exporting functions with reactjs and babel
- Deep nested array of objects not rendering
- import * as React from ‘react’; vs import React from ‘react’;