I'm learning React from this channel. Recently, I stumbled upon React Hooks from here. So, I tried to convert a class based component to hook based. Here is my class based component:
Here is my converted component: https://codesandbox.io/s/n0lw4wo550?module=%2Fsrc%2FAddNinja.js
But I'm getting following error:
React hooks are available in React v16.8.0
. updated your react and react dom version to 16.8.0
.
"react": "16.8.0",
"react-dom": "16.8.0",
Here is your code with updated verion:https://codesandbox.io/s/qq90900xr4