Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Update props without refreshing #110

Open
thekidchad opened this issue Jan 12, 2021 · 1 comment
Open

Update props without refreshing #110

thekidchad opened this issue Jan 12, 2021 · 1 comment
Labels
question Further information is requested

Comments

@thekidchad
Copy link

thekidchad commented Jan 12, 2021

Hi,
Im looking for a solution to update props of react-canvas-draw realtime.
I didnt find any solution to re-render the canvas.

For example :
<CanvasDraw ref={(canvasDraw) => (this.saveableCanvas = canvasDraw)} brushColor={"#000"} brushRadius={1} hideGrid={() => this.setState({ hideGrid: true })} />

doesnt remove the grid in a realtime. May we need to rerender the canvasdraw ? How can we do it ?

Anybody has a solution ?
Best regards

@lfdom
Copy link

lfdom commented Apr 19, 2021

Use the key prop from react,

key={`id-${showGrid}`}

that will force the component to re-render

@embiem embiem added the question Further information is requested label Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants