Answers for "react arrow function component"

1

use const when declaring an arrow function in React class component

//Error:The 'const' modifier can only be used in TypeScript files.
If you're creating an instance method(method inside a class component), 
then no you don't need const. 

If you're creating a generic (i.e. utility) function OUTSIDE of a component, 
then yes you probably should use const.
Posted by: Guest on August-23-2021
0

react arrow function component

import React from 'react'

const buttons = () => {
    return (
        <div>
            
        </div>
    )
}

export default buttons
Posted by: Guest on August-27-2021
0

react arrow funvtion

//declaring arrow function

hello = () => {
	return "hello world";
}
Posted by: Guest on March-01-2021

Code answers related to "react arrow function component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language