Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: div: ref is not a prop #30367

Closed
SaintPepsi opened this issue Jul 17, 2024 · 5 comments
Closed

Bug: div: ref is not a prop #30367

SaintPepsi opened this issue Jul 17, 2024 · 5 comments
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@SaintPepsi
Copy link

SaintPepsi commented Jul 17, 2024

Using Vite & React we're getting the weirdest error i've seen in all my react career:

Warning: div: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)

I'm clueless, how does react warn me that ref is not a prop for <div>?

Accompanied is a whole bunch of other errors related to contexts:

Warning: _RichTextEditor: `key` is not a prop.
Warning: Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?
Warning: Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?

React version: 18.3.1

Steps To Reproduce

We tried to reproduce it but it does not happen in a minimal example.
Please advice on tactics/methods to write a minimal reproducible to try and get this error.

The component giving this error is rendering a createPortal to the document.body:

image

Large Node Tree With recursively rendered components and form elements just to show it's a complex application which I think is what contributes to why we can't replicated it.

image

Link to code example: WIP

The current behavior

VM18671:1 Warning: div: ref is not a prop. Trying to access it will result in undefined being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)

The expected behavior

No Error

@SaintPepsi SaintPepsi added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Jul 17, 2024
@eps1lon
Copy link
Collaborator

eps1lon commented Jul 22, 2024

Do you have multiple versions of React installed?

@SaintPepsi
Copy link
Author

@eps1lon No, however we did notice that this only happens when adding console logs strangely enough, It might have something to do with vite actually 🤔

@sqndr

This comment was marked as off-topic.

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Oct 31, 2024
Copy link

github-actions bot commented Nov 7, 2024

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants