Answers for "use const when declaring an arrow function in React class 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

Code answers related to "use const when declaring an arrow function in React class component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language