react-native-responsive-screen icon indicating copy to clipboard operation
react-native-responsive-screen copied to clipboard

How to use the lor() method in the function component

Open codthing opened this issue 3 years ago • 11 comments

codthing avatar Apr 20 '21 01:04 codthing

In my PR for supporting functional components, I modified listenOrientationChange() to support being called via hooks/functional or class components.

gregfenton avatar Apr 20 '21 03:04 gregfenton

Thank @gregfenton Your PR was still not merged, so how can I use your changes ?

vankhoa01 avatar Jul 06 '21 02:07 vankhoa01

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"

gregfenton avatar Jul 06 '21 04:07 gregfenton

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 ?

Screen Shot 2021-07-06 at 11 21 31

Thank you so much

vankhoa01 avatar Jul 06 '21 04:07 vankhoa01

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 avatar Jul 06 '21 13:07 gregfenton

@gregfenton : Thank for your supporting Let me try with your solution Thank you so much

vankhoa01 avatar Jul 07 '21 00:07 vankhoa01

@marudy @gregfenton Still not merged?

swalahamani avatar Aug 29 '21 10:08 swalahamani

@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

swalahamani avatar Aug 29 '21 11:08 swalahamani

@gregfenton Kindly check https://github.com/gregfenton/react-native-responsive-screen/pull/1

swalahamani avatar Aug 29 '21 11:08 swalahamani

Sorry, I'm unable to maintain this project fork at this time.

gregfenton avatar Aug 29 '21 18:08 gregfenton

@gregfenton No worries, thanks for the response and the patch!

swalahamani avatar Sep 02 '21 13:09 swalahamani