Skip to content

In column placing the components causing tree re-rendering  #1269

@AsjidAle

Description

@AsjidAle

Describe the bug

When we pass buttons as the props in the columns and it cause to tree re-render. But it's illegal practice, do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state. Instead, move this component definition out of the parent component “Categories” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true.

To Reproduce

Steps to reproduce the behavior:

  1. In the columns pass the img or buttons component and pass prop to it
  2. See Error: the Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state. Instead, move this component definition out of the parent component “Categories” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions