Open thekidchad opened 3 years ago
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 })} />
<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
Use the key prop from react,
key={`id-${showGrid}`}
that will force the component to re-render
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