Question · JavaScript and React course · Module 2: Components and Props

Single Responsibility Principle

What does the Single Responsibility Principle mean in the context of React components?

Answer options

  • Each component should be responsible for one aspect of the user interface
  • Each component can only have one prop
  • Every component must be exported as default
  • Every component must be wrapped in React.memo
Show the answer

Correct answer:

  • Each component should be responsible for one aspect of the user interface