📜  在 React 类组件中声明箭头函数时使用 const - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:28.857000             🧑  作者: Mango

代码示例1
//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.