reactivesearch icon indicating copy to clipboard operation
reactivesearch copied to clipboard

ReactiveComponent re renders custom component within render props

Open aoloo opened this issue 3 years ago • 1 comments

Affected Projects React

Library Version: x.y.z ^3.18.1

Describe the bug When utilizing ReactiveComponent and rendering a custom component in render prop. ReactiveComponent re renders numerous number of times causing performance issues.

To Reproduce https://codesandbox.io/s/reactive-component-re-renders-ynqth?file=/src/index.js In a small code sandbox implementation, the sandbox console outputs the re rendered value within the render props.

Within a bare bones implementation in production environment the component is rendered more than 200 times. Expected behavior The component in render props should only be rendered once than multiple times.

Screenshots image image

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Browser: [Chrome ]
  • Version [90.0.4430.212 ]

Smartphone (please complete the following information): N/A

Additional context N/A

aoloo avatar Jun 02 '21 19:06 aoloo

@aoloo Thanks for bringing attention to this, I'm able to reproduce it. We will be fixing this in the next release.

The same issue is replicable with:

  • <ReactiveGoogleMap>, <ReactiveOpenStreetMap> (renders 4 - 6x) and
  • <ReactiveList> https://codesandbox.io/s/fervent-raman-25si4 (renders 2x)

components as well.

siddharthlatest avatar Jul 01 '21 16:07 siddharthlatest