question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Since version 1.0.7 NavigationDrawer does not initially set drawerType on first render

See original GitHub issue

Description

First of all, thanks for creating react-md. Of all the other react material ui frameworks out there we found react-md to be the most sane, performant and comprehensive.

So, it appears after Drawer change in version 1.0.7 (https://github.com/mlaursen/react-md/commit/81d8515c379214947ada59451968a5edd93da6da) the NavigationDrawer media type is no longer being initially set when the component mounts. I have to manually resize the browser for the drawer to correctly appear.

https://codepen.io/johnnyazee/pen/xqdoZR?editors=0010

If I add defaultMedia="desktop" to then everything is fine on initial render in desktop mode, however, on an initial render on mobile or tablet device the media type for mobile is not updated. Resizing the browser triggers the media type to correctly set the drawer visibility/mode type.

My previous version was 1.0.6.

Version

  • React latest
  • React-MD 1.0.7

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mlaursencommented, Mar 13, 2017

To make my life a little bit easier, I am going to make the assumption that if visible or defaultVisible is true on initial mount for the NavigationDrawer or Drawer, you have done some calculations yourself to make sure you really do want it visible until a resize event. It will still do any media type changes, just keep the visibility as-is until resize.

0reactions
jmealocommented, Mar 14, 2017

Great teamwork here guys. Quite the community. I feel even better about giving react-md a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

drawer First load blink · Issue #7515 · react ... - GitHub
In your drawer's render method, check if initialRender is true. If it's true, set it to false and return null. Set the drawerBackgroundColor...
Read more >
Drawer Navigator | React Navigation
When this is set to open , the drawer will be open from the initial render. It can be closed normally using gestures...
Read more >
How to set an initial screen that is not shown in drawer ...
I want to set the map screen as initial but don't want to show that on drawer. How could i do that? reactjs...
Read more >
Custom Drawer Navigator in React Navigation 6 - YouTube
In this tutorial, you'll learn to implement the drawer navigator in react navigation v6 and customize it. Here I have shown you how...
Read more >
react-native-screens - npm
It is not designed to be used as a standalone library but rather as a ... Since version 2.0.0 react-native-screens requires RN v0.60+....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found