Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am still using this (lol) #405

Open
nabilfreeman opened this issue Oct 2, 2024 · 0 comments
Open

I am still using this (lol) #405

nabilfreeman opened this issue Oct 2, 2024 · 0 comments

Comments

@nabilfreeman
Copy link

nabilfreeman commented Oct 2, 2024

It works quite well with the addition of the following patch:

diff --git a/node_modules/react-native-drawer/index.js b/node_modules/react-native-drawer/index.js
index ad60ecc..b949f00 100644
--- a/node_modules/react-native-drawer/index.js
+++ b/node_modules/react-native-drawer/index.js
@@ -117,7 +117,7 @@ export default class Drawer extends Component {
     this._childDrawer = drawer
   }
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     if (this.context.drawer) this.context.drawer._registerChildDrawer(this)
     if (this.props.openDrawerThreshold && process.env.NODE_ENV !== 'production') console.error('react-native-drawer: openDrawerThreshold is obsolete. Use panThreshold instead.')
     if (this.props.panStartCompensation && process.env.NODE_ENV !== 'production') console.error('react-native-drawer: panStartCompensation is deprecated.')
@@ -125,7 +125,7 @@ export default class Drawer extends Component {
     this.initialize(this.props)
   }
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     if (this.requiresResync(nextProps)) this.resync(null, nextProps)
 
     if (nextProps.open !== null && this._open !== nextProps.open) {

However performance is definitely not perfect as it's the only part of our app consistently dropping frames as it opens and closes.

Is there any better solution, via an alternative library or patching this one?

p.s. I don't want to add a stack navigator just to get a drawer opening and closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant