react-swipeable-drawer
react-swipeable-drawer copied to clipboard
Make sure it works with preact
This library is very small and standard. Also the build process comes from downshift which supports preact. So I have a feeling that it should work with preact as well, but haven't confirmed it yet, and have no experience with preact.
I'd love for a preact user to tell me if react-swipeable-drawer
works with preact, and if not, what is necessary in order to support it.
Super late to the game but I get:
Ah, yes, I think I know why! I recently learned that in preact children is always an array, so we'd have to get the function at index 0 first.
@tyleralves, are you interested in using this lib? I haven't touched it in a while but could try to update it. I would also welcome a PR!
I would love to use this as there isn't a bottom sheet (drawer) in preact-material-components
. I don't think I have the expertise to make this change, but I would certainly use it and give you feedback.
I was able to just add children[0]
to the dist build and get it working, but am having issues with position: 'bottom'
not seeming to drag out. Any examples for bottom sheets?
Thanks for the help!
mmmh, I have bad news.
-
while there is an easy fix for making this lib working with Preact, the test/build/publish pipeline seems broken, and I don't think I can fix it easily without upgrading a lot of dependencies
-
even then, the bottom and top drawers were never swipeable. It would be possible to update the code to handle that case, but that would also require some time
I might do all of that eventually, but there's no telling when.
If you still want to use that code, what I would recommend, is that you copy/paste the code in your project directly, and make the necessary changes there. It's only 5 files of React components after all, and if I remember correctly there is no other dependency.