I\'m trying to implement a React smart component using functions as shown here https://hackernoon.com/react-stateless-functional-components-nine-wins-you-might-have-overlook
From React 16.8.0 You can use Hooks using useState to instantiate a State custom in your Functional Component. Like This...
import React, {useState} from 'react';
const AddButon = ({handleAddValue}) => {
return
}
const App = (props) =>{
const [value, setValue] = useState(0);
const handleAddValue = () => {
const newValue = value+1;
setValue(newValue);
}
return (
The Value is: {value}
);
}
If you want to read more about this new functionality, follow the following link.
https://reactjs.org/docs/hooks-intro.html