-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
I am unable to work around this error when I import and use this package in a NextJS static build project. It behaves as if React.Component is not available. It seems Class components are disfavoured in recent versions of React, but not deprecated, and at any rate react-headroom specifies react@^18, so I am confused why this causes a problem here. Any advice would be welcome, thankyou.
Minimal reproduction
import { Headroom } from "react-headroom"
export default function MyThing () {
return (
<Headroom>
<h1>My Thing</h1>
</Headroom>
)
}- Also happens when importing default (
import Headroom from "react-headroom") - Doesn't happen if the component is imported but not used
More Context
- Using Typescript/tsx
- Yarn PM
- react@18.2.0
- next@13.4.3
- react-headroom@3.2.1
- typescript@5.0.4
Metadata
Metadata
Assignees
Labels
No labels