InterviewHubPRO
Section Overview
Q383

Question 383 of 445

Part 11: Legacy Architecture, Migration Patterns & Historical Internals (354 - 445)

86%
React & Modern Frontend (445 Qs)•Part 11: Legacy Architecture, Migration Patterns & Historical Internals (354 - 445)

What is the recommended way for naming components?

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

go
Using `displayName` for naming component:
javascript
    export default React.createClass({
      displayName: "TodoApp",
      // ...
    });
markdown
The **recommended** approach:
javascript
    export default class TodoApp extends React.Component {
      // ...
    }
also
javascript
    const TodoApp = () => {
      //...
    };
    export default TodoApp;