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

Develop branch: Cannot assign to read only property 'name' of function #246

Closed
insekticid opened this issue Feb 19, 2021 · 2 comments
Closed

Comments

@insekticid
Copy link

insekticid commented Feb 19, 2021

return Object.assign(forwardRef((component as unknown) as any) as any, { name: component.name })

caused by headlessui.esm.js:1511

let DialogRoot = forwardRefWithAs(function Dialog<

headlessui.esm.js:252 Uncaught TypeError: Cannot assign to read only property 'name' of function 'function t(t,e){var r=C({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}'
   at Function.assign (<anonymous>)
   at forwardRefWithAs (headlessui.esm.js:252)
   at Module../node_modules/@headlessui/react/dist/headlessui.esm.js (headlessui.esm.js:1511)
   at __webpack_require__ (bootstrap:848)
   at fn (bootstrap:150)
   at Module../assets/components/Dropdown.js (app.js:18)
   at __webpack_require__ (bootstrap:848)
   at fn (bootstrap:150)
   at Module.<anonymous> (app.js:4370)
   at Module../assets/app.js (app.js:4938)
RobinMalfait added a commit that referenced this issue Feb 19, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
RobinMalfait added a commit that referenced this issue Feb 19, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed, and will be available in the next release.
You can already try it using npm install @headlessui/react@dev or yarn add @headlessui/react@dev.

@insekticid
Copy link
Author

insekticid commented Feb 19, 2021

it works! thanks.

dialog tailwind preview

image

RobinMalfait added a commit that referenced this issue Mar 22, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
RobinMalfait added a commit that referenced this issue Mar 26, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
RobinMalfait added a commit that referenced this issue Apr 2, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
RobinMalfait added a commit that referenced this issue Apr 2, 2021
This allows us to read a custom `displayName`, and we can default to a
`name`. React Devtools will still be able to read this information.

Fixes: #246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants