react-swipeable-drawer icon indicating copy to clipboard operation
react-swipeable-drawer copied to clipboard

Make sure it works with preact

Open damusnet opened this issue 7 years ago • 5 comments

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.

damusnet avatar Sep 05 '17 01:09 damusnet

Super late to the game but I get: Screen Shot 2019-04-28 at 11 07 45 AM

tyleralves avatar Apr 28 '19 18:04 tyleralves

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!

damusnet avatar Apr 28 '19 18:04 damusnet

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.

tyleralves avatar Apr 28 '19 18:04 tyleralves

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!

tyleralves avatar Apr 28 '19 19:04 tyleralves

mmmh, I have bad news.

  1. 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

  2. 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.

damusnet avatar Apr 28 '19 23:04 damusnet