reanimated-color-picker icon indicating copy to clipboard operation
reanimated-color-picker copied to clipboard

[Reanimated] Reading from `value` during component render.

Open iameli opened this issue 8 months ago • 2 comments

I'm using color picker in a very boring way:

      <ColorPicker>
        <Preview />
        <Panel1 />
        <HueSlider />
        <Swatches />
      </ColorPicker>

Nonetheless I'm generating a warning on every render:

hook.js:608 [Reanimated] Reading from `value` during component render. Please ensure that you do not access the `value` property or use `get` method of a shared value while React is rendering a component.

If you don't want to see this message, you can disable the `strict` mode. Refer to:
https://docs.swmansion.com/react-native-reanimated/docs/debugging/logger-configuration for more details.

iameli avatar Apr 05 '25 01:04 iameli

I tried replicating this using your example but didn't see the warning. Since the warning doesn’t specify where it originates, it could be coming from somewhere else in your codebase. For example, accessing a SharedValue during render like <ColorPicker value={selectedColor.value} /> can trigger it.

alabsi91 avatar Apr 05 '25 09:04 alabsi91

Preview component caused this. I fixed it in the latest PR.

Seras3 avatar Apr 05 '25 17:04 Seras3