-
Notifications
You must be signed in to change notification settings - Fork 136
Dynamically changing props (e.g. visibleEdgeColor) of Outline breaks it / no longer renders #143
Open
Description
Problem
Demo of bug and workaround: https://codesandbox.io/s/bug-change-outline-color-dmu52j?file=/src/App.js
✅ Constant/fixed visibleEdgeColor
<EffectComposer multisampling={8} autoClear={false}> <Outline blur edgeStrength={100} width={500} visibleEdgeColor="red" /> </EffectComposer>
🔥 Dynamically changing visibleEdgeColor breaks Outline, stops rendering
+ // `color` variable is dynamically changing <EffectComposer multisampling={8} autoClear={false}> <Outline blur edgeStrength={100} width={500} + visibleEdgeColor={color} /> </EffectComposer>
Workaround
Changing the
visibleEdgeColorof Outline element breaks it.
Workaround is to change thekeyofEffectComposerso everything re-mounts and re-renders.
<EffectComposer
multisampling={8} autoClear={false}
+ key={color}
>
<Outline
blur edgeStrength={100} width={500}
- visibleEdgeColor={"red"}
+ visibleEdgeColor={color}
/>
</EffectComposer>To see this in action, change the APPLY_WORKAROUND in the demo sandbox.
Is this expected behaviour? Thanks!
Activity
Metadata
Metadata
Assignees
Labels
No labels