Closed do-wa closed 1 year ago
Sorry for not responding earlier. I would love to support LazyMotion but I'm not quite sure how to do it 🤔
Maybe it would be possible to to export a lazy version like so:
import LazySheet from 'react-modal-sheet/lazy';
I'll try to investigate this when I have some free time 🕵🏻♂️
Not planning on supporting this for now. Feel free to open a PR if this is still needed 🙂
Hi!
first of all: Great work and thank you for this lib.
I was wondering if you see any way to support LazyMotion (https://www.framer.com/api/motion/guide-reduce-bundle-size/) inside your package.
I tested an initial implementation (really just replacing the
motion
import withm
) and published it for my personal project. https://www.npmjs.com/package/react-lazy-modal-sheetThe caveat is of course the requirement to use
LazyMotion
in a root component which needs to be handled in user space (afaik).Do you think there is any way to support both lazy and non-lazy users? Or is this a bad idea? Maybe the solution would be to have a build step which replaces the import and publish two separated packages?
If you don't care about this, I would try to regularly fetch the upstream changes and update my published package.
Greetings
do-wa