react-native-responsive-screen
react-native-responsive-screen copied to clipboard
How to use the lor() method in the function component
In my PR for supporting functional components, I modified listenOrientationChange() to support being called via hooks/functional or class components.
Thank @gregfenton Your PR was still not merged, so how can I use your changes ?
I've been successfully using my PR in production since Sep 2020.
I think you can install my PR with the command
npm install git+https://github.com/gregfenton/react-native-responsive-screen.git
??
In my package.json I end up with the "dependencies"
containing:
"react-native-responsive-screen": "github:gregfenton/react-native-responsive-screen"
Hi @gregfenton : Thank for your reply I already installed your package, but I can not resolved currentOrientation Could you give me some hint to fix them ?

Thank you so much
Have you tried running any of the examples that ship with the project?
That's where I would start. Those projects each have a README telling you how to set up and run them. If you get the example working, then you can compare your project with the example project to determine what is different.
Maybe start with the example that I added as part of the PR.
@gregfenton : Thank for your supporting Let me try with your solution Thank you so much
@marudy @gregfenton Still not merged?
@gregfenton Typescript support pending?
Argument of type '{ setStateHook: React.Dispatch<React.SetStateAction<undefined>>; }' is not assignable to parameter of type 'Component<any, any, any>'. Object literal may only specify known properties, and 'setStateHook' does not exist in type 'Component<any, any, any>'.ts(2345) (property) setStateHook: React.Dispatch<React.SetStateAction<undefined>> No quick fixes available
@gregfenton Kindly check https://github.com/gregfenton/react-native-responsive-screen/pull/1
Sorry, I'm unable to maintain this project fork at this time.
@gregfenton No worries, thanks for the response and the patch!