[labs/react] Warning: Invalid attribute name: `_$Gl`
See original GitHub issueWhich package(s) are affected?
React (@lit-labs/react)
Description
When using a ref
with a react wrapper around my Lit component:
<MyReactWrapper ref={console.log} />
I see the following error logged in the console:
Warning: Invalid attribute name: `_$Gl`
After doing some digging, this identifier _$Gl
appears in the minified published code of @lit-labs/react
. In the source this corresponds to __forwardedRef
.
I am wondering if the minification has been overly aggressive and has mangled the property?
Previously i raised an issue relating to refs causing an l
attribute to appear in DOM: https://github.com/lit/lit/issues/2593
It seems like this is the same bug, but now instead of the incorrectly adding a valid attribute name, it is incorrectly adding an invalid attribute name
Reproduction
Check the console here: https://stackblitz.com/edit/react-ts-1d2hjj?file=App.tsx%3AL9
Workaround
n/a
Is this a regression?
No or unsure. This never worked, or I haven’t tried before.
Affected versions
1.0.8
Browser/OS/Node environment
Browser: Chrome 105.0.5195.125
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
Awesome thanks! I’ve had a few developers ask me why this was getting logged by our design system. Will keep and eye out for the release, then test and report back 👍
#3408 was the more durable option, and yes it resolves this issue 😃 This will be apart of the next Lit release