react-grid-layout / react-grid-layout/react-draggable

Getting propType console error for props not passed into Draggable component

Open
#555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9.3k
Forks
1k
Avg merge
3d 8h
Merged PRs (30d)
4

Description

Issue: In my React app on the first rendering of the Draggable component I am getting the following console errors. I have only imported and implemented the Draggable component and not the DraggableCore component. After the first render I am not getting the console errors anymore

Screenshots of console errors:
image
image
image
image

Research Notes: When I was digging through the react-draggable npm package I noticed that this issue is caused because the dontSetMe() function located in shim.js file the is getting called. I am assuming that a default value is being set for the className and styles on first render.

Proposed solution: Only show the console errors if the className and style prop have been set in the Draggable or DraggableCore components that have been implemented in the source code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with shim.js and trace how dontSetMe() is reached from the Draggable and DraggableCore components during the first render. Confirm the behavior with the reported propType warnings, then verify that warnings appear only when className or style was explicitly provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.