0

Is there a way to accomplish this :

Android Remove Shadow On Navigation Drawer

in React Native ?

I see no properties for doing that in the DrawerLayoutAndroid documentation

Community
  • 1
  • 1
Karim Mortabit
  • 692
  • 2
  • 9
  • 19

1 Answers1

1

You are right in that the RN API does not offer a way to parametrize that property, but the DrawerLayoutAndroid component extends from the native DrawerLayout, and so you can just tweak a bit the source code to include the desired functionality. Have a look here and here.

Of course, messing around with RN's code might be a bit messy, so what you can do is just take those files and refactor them into a separate component that extends your functionality. I built such component and put it in a repo so that you can have a look. Here's the link: https://github.com/martinarroyo/DrawerLayoutNoShadow Particularly have a look at this line.

I set the value to transparent, but you can put any other color you'd like and it should work. A very good idea would be to pass the value as a prop, but the essentials should be covered with the code in the repo.

Hope that helps.

martinarroyo
  • 9,389
  • 3
  • 38
  • 75