-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
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:
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.
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

