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
How to use onChange and onClick event in React JS?
How to get a clicked HTML element in React?
Example of React Bootstrap Datatable
How to show hide component on Click in React JS?
onClick Event binding and get event name in ReactJs
How to create simple React Router to navigate multiple pages?
React Static Website with Material UI theme
React JS update Div content on click
How to use function inside JSX expression?
onMouseDown and onMouseUp Event handling in ReactJs