Back to all reviewers

Follow React component patterns

twentyhq/twenty
Based on 2 comments
TSX

React components should be rendered as standard JSX elements, not called as functions, and should follow established architectural patterns. This ensures consistency with React conventions and maintainability.

React TSX

Reviewer Prompt

React components should be rendered as standard JSX elements, not called as functions, and should follow established architectural patterns. This ensures consistency with React conventions and maintainability.

When you see a component being called as a function like WorkflowActionMenuItems(props), refactor it to proper JSX syntax: <WorkflowActionMenuItems {...props} />. Additionally, ensure components have proper data backing and follow established patterns in the codebase.

Example of incorrect usage:

{WorkflowActionMenuItems(HUMAN_INPUT_ACTIONS, theme, handleCreateStep)}

Example of correct usage:

<WorkflowActionMenuItems 
  actions={HUMAN_INPUT_ACTIONS} 
  theme={theme} 
  onCreateStep={handleCreateStep} 
/>

This pattern maintains React’s declarative nature and ensures components integrate properly with React’s rendering system and developer tools.

2
Comments Analyzed
TSX
Primary Language
React
Category

Source Discussions