react-modal-sheet icon indicating copy to clipboard operation
react-modal-sheet copied to clipboard

LazyMotion Support/Integration

Open do-wa opened this issue 4 years ago • 1 comments

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 with m) and published it for my personal project. https://www.npmjs.com/package/react-lazy-modal-sheet

The 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

do-wa avatar Jun 16 '21 09:06 do-wa

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 🕵🏻‍♂️

Temzasse avatar Sep 30 '21 09:09 Temzasse

Not planning on supporting this for now. Feel free to open a PR if this is still needed 🙂

Temzasse avatar Oct 07 '22 19:10 Temzasse