Skip to content
public-library›Rules›React›Do not define components inside components

Do not define components inside components

Declare components at module level and pass them the data they need as props. Do not create a component function or class inside another component's render.

In the full rule