Re-export the ReferenceObject type of popper.js with the Popper component
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
Should be able to import the ReferenceObject
interface from material-ui instead of popper.js
.
Examples 🌈
Current way:
import { ReferenceObject } from 'popper.js'
import { Popper } from '@material-ui/core'
export default function ExamplePopperWrapper({
anchorEl
}: {
anchorEl: ReferenceObject
}) {
return <Popper anchorEl={anchorEl} />
}
Proposed way:
import { Popper, PopperReferenceObject } from '@material-ui/core'
export default function ExamplePopperWrapper({
anchorEl
}: {
anchorEl: PopperReferenceObject
}) {
return <Popper anchorEl={anchorEl} />
}
I don’t know where it should be exported from, but somewhere in the material-ui core package. Otherwise, the abstraction is broken.
Motivation 🔦
Typing my code properly without breaking abstraction or adding dependencies that are not directly used.
Thanks 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Re-export the ReferenceObject type of popper.js with ... - GitHub
I don't know where it should be exported from, but somewhere in the material-ui core package. Otherwise, the abstraction is broken. Motivation ...
Read more >Popper (v1.×)
The dataObject is an object containing all the information used by Popper.js. This object is passed to modifiers and to the onCreate and...
Read more >Migration Guide | Popper
In Popper 1, it was a class: import Popper from 'popper.js'; new Popper(reference, popper, options);. In Popper 2, it's now a function:.
Read more >How to fix this errors when instaling @popperjs/core
In ./.angular.json at the row scripts : "../node_modules/popper.js/dist/esm/popper.js". or: "../node_modules/popper.js/dist/umd/popper.js".
Read more >React Popper component - Material UI - MUI
A Popper can be used to display some content on top of another. It's an alternative to react-popper.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Something like
@eps1lon’s approach sounds perfect, @DaniGuardiola let us know if you face any limitations with it.