How to use arrow function in React stateless components?
Stateless components can be defined using the fat arrow syntax, which exclude the use of return keyword.
Example
import React, { Component } from 'react';
export default () =>
<h1 className="bg-secondary text-white text-center p-2">
Hello World
</h1>
Most Helpful This Week
React Elements
How to use React-Bootstrap component?
React JS get Tag Name and Inner Text on Click
React Static Website with Material UI theme
3 Different Examples - How State Works in React?
React Props
React JS Count number of checkboxes are checked
How to pass data from child component to its parent in ReactJS?
How to get a clicked HTML element in React?
What is state in React?