react-joystick-component icon indicating copy to clipboard operation
react-joystick-component copied to clipboard

Enhance for use on mobile

Open surfertas opened this issue 6 years ago • 10 comments

Hi, thanks a lot for this.

I was wondering if you plan to have this work with mobile?

surfertas avatar Aug 04 '18 16:08 surfertas

Thanks! Yes. I need to do more investigation, which i should have time for in the next 2 weeks. At present it shouldn't work with React Native as it uses divs but I'm fairly new to RN, so I need to research the best way to do it first, but I don't think it will be too difficult.

elmarti avatar Aug 04 '18 17:08 elmarti

Great to hear. Was wondering if the expectation is that reactjs alone should work on web accessed via a mobile? If that is the case then it does not work at the moment.

surfertas avatar Aug 05 '18 11:08 surfertas

Yeah, I noticed that, it should be fairly simple to add just need to look for the best way to do it

elmarti avatar Aug 05 '18 13:08 elmarti

Added touch support in v1.2.0, keeping this open for React Native support

elmarti avatar Aug 06 '18 14:08 elmarti

Help wanted, if anyone can advise the best way of creating component for both RN and ReactDOM

elmarti avatar Aug 06 '18 15:08 elmarti

@surfertas does the 1.2.0 release solve your problem?

elmarti avatar Aug 10 '18 14:08 elmarti

It sure does. Thanks a lot.

surfertas avatar Aug 10 '18 23:08 surfertas

I will be working on this soon to add React Native support. I've done a bit more React Native work and I think the best way would be to export via '@react-joystick-component/native'

elmarti avatar Jan 25 '19 10:01 elmarti

have you had a chance to work on giving React Native support?

Sabari2810 avatar May 14 '23 14:05 Sabari2810

I'm still exploring ways to do this without inflating the package size - unfortunately the even lifecycles and styling systems in React Native are very different, so there's no easy solution, but my thoughts are:

  • abstract common functionality
  • create new package e.g react-joystick-core and store all of the core functionality there in
  • create a new package called react-native-joystick-component (or similar)
  • utilise the core library in both

This would require a significant rewrite, but i'll have a look into it - and get back in the next week

elmarti avatar May 17 '23 15:05 elmarti