Skip to content
Advertisement

Change class component to functional component with props

I am trying to convert a class component to functional component but i keep getting problem, I think im doing it wrongly

Class Component:

JavaScript

This is what i try to do as my Functional Component (Please note I dont understand function component just yet)

JavaScript

Its not giving me the desired output, I have tried tweaking it, still!,

Advertisement

Answer

Try this one, please.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement