MCPcopy
hub / github.com/bokuweb/react-rnd / componentDidMount

Method componentDidMount

src/index.tsx:238–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 }
237
238 componentDidMount() {
239 this.updateOffsetFromParent();
240 const { left, top } = this.offsetFromParent;
241 const { x, y } = this.getDraggablePosition();
242 this.draggable.setState({
243 x: x - left,
244 y: y - top,
245 });
246 // HACK: Apply position adjustment
247 this.forceUpdate();
248 }
249
250 // HACK: To get `react-draggable` state x and y.
251 getDraggablePosition(): { x: number; y: number } {

Callers

nothing calls this directly

Calls 2

getDraggablePositionMethod · 0.95

Tested by

no test coverage detected