react-native-camera-hooks icon indicating copy to clipboard operation
react-native-camera-hooks copied to clipboard

Upstreaming the hooks into the Official RN Camera

Open mauriciord opened this issue 5 years ago • 3 comments

We've been planning to migrate to hooks for a long time, and we found this codebase that is a good code design and an easy developer experience to use, so we propose that this repo codebase be moved into the RN Camera Official Repo as the canonical source.

I discussed with @sibelius and he encouraged the idea.

Maybe there are a few things that need to be improved:

  • Improve TS support
  • Total removal Flow from RN Camera

What do you think?

mauriciord avatar Apr 20 '20 17:04 mauriciord

You can view a lot of Pull Requests trying to implement hooks, maybe you could implement it as one more option.

mauriciord avatar Apr 20 '20 17:04 mauriciord

That could really makes sense and I agree with both of your points. I don't see too much of a benefit besides removing the "soon" deprecated lifecycle methods and re-organizing the code.

I suggest that we convert RNCamera.js to a TypeScript + functional component and then implement the necessary hooks step by step. That way, we keep legacy support until we can make a major version bump and also remove flow. Or do you have a better idea? @mauriciord

And what do you think about the support for expo?

reime005 avatar Apr 22 '20 21:04 reime005

@reime005

I suggest that we convert RNCamera.js to a TypeScript + functional component and then implement the necessary hooks step by step. That way, we keep legacy support until we can make a major version bump and also remove flow. Or do you have a better idea?

I think it works :-)

And what do you think about the support for expo?

We can import the hooks of react native camera into the expo-camera, because they probably will be unified in the future.

mauriciord avatar Apr 22 '20 21:04 mauriciord