in React JS by
What is the recommended way for naming components?

1 Answer

0 votes
by

It is recommended to name the component by reference instead of using displayName.

Using displayName for naming component:

export default React.createClass({

  displayName: 'TodoApp',

  // ...

})

The recommended approach:

export default class TodoApp extends React.Component {

  // ...

}

Related questions

0 votes
asked Jul 10 in ElasticSearch by sharadyadav1986
0 votes
+1 vote
asked Jun 25, 2021 in Redux by SakshiSharma
0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
...