October 2019
Intermediate to advanced
426 pages
11h 49m
English
Now, we define the same component as a function component:
import React, { useState } from 'react'
function MyName () {
The next step would be to get the name variable from the component state. However, we cannot use this.state in function components. We have already learned that Hooks are just JavaScript functions, but what does that really mean? It means that we can simply use Hooks from function components, just like any other JavaScript function!
To use state ...
Read now
Unlock full access