1 / 6

Custom drawer with react-navigation in react-native

Best Custom Drawer with React Navigation in React native. This Article provides the step by step Guide for

Hellohardy
Télécharger la présentation

Custom drawer with react-navigation in react-native

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1.     Skyward Skyward​​​​Softwares Softwares​​​​& &​​​​Solutions Solutions       Step​​By​​Step​​Guide​​for  Beginners-​​React​​Native     Custom Custom​​​​drawer drawer​​​​with with​​​​react-navigation react-navigation​​​​in in​​​​react-native react-native​​​​: :​​​​Skyward Skyward​​​​Softwares Softwares​​​​& &​​​​Solutions Solutions         by​​​Bhaktipriya​​Panchal​​​​​on​​July​​25th       I​​was​​working​​on​​a​​react-native​​app​​in​​which​​I​​used​​​​react-navigation React-navigation​​provides​​3​​different​​types​​of​​navigators​​–​​​​Stack and​​they​​worked​​well​​except​​of​​Drawer.​​I​​faced​​some​​issues​​while​​integrating​​Drawer  navigator.  react-navigation​​​​for​​routing.  Stack​​,​​​​Tab Tab​​,​​​​Drawer Drawer​​.​​I​​used​​all   

  2.   My​​app​​require​​to​​display​​drawer​​only​​in​​few​​pages​​but​​react-navigation​​drawer​​is​​available  in​​all​​pages​​throughout​​the​​app.​​Yes,​​it’s​​possible​​using​​nested​​routes​​but​​still​​there​​are  different​​set​​of​​problems.​​I​​was​​able​​to​​open​​drawer​​by​​swiping​​in​​any​​page.​​My​​app​​needed  to​​open​​drawer​​by​​​click click​​​​and​​not​​by​​​swipe swipe​​.​​Also​​I​​was​​not​​able​​to​​access​​Drawer​​Navigator  instance​​from​​any​​other​​component.​​I​​don’t​​found​​any​​useful​​documentation​​that​​help​​me  to​​fulfill​​my​​requirements,​​so​​I​​took​​a​​third-party​​drawer​​module​​and​​created​​custom  drawer​​using​​redux​​option​​of​​react-navigation.  Links​​which​​I​​referred​​but​​have​​not​​found​​any​​meaningful​​solution  https://github.com/react-community/react-navigation/issues/131  https://github.com/react-community/react-navigation/issues/967  https://github.com/react-community/react-navigation/issues/725                        This​ ​Article​ ​shows​ ​an​ ​example​ ​of​ ​how​ ​we​ ​can​ ​integrate​ ​custom​ ​drawer​ ​in​ ​react-navigation.   It​ ​uses​ ​‘​react-native-drawer​‘​ ​module.  Create​ ​react-native​ ​app​ ​and​ ​setup​ ​redux.         

  3.        

  4.     Then​​define​​some​​routes​​using​​​Stack are​​two​​routes​​–​​‘Home’​​and​​‘About’.​​Home​​screen​​will​​contain​​a​​​menu click​​of​​which​​drawer​​can​​be​​open.​​About​​screen​​will​​have​​​back Home​​screen. Stack​​​​Navigator Navigator​​​​of​​react-navigation.​​In​​this​​example​​there  menu​​​​icon arrow​​​​icon icon​​​​in​​header​​on  icon​​​​to​​go​​back​​to  back​​​​arrow   Now​​lets​​integrate​​Drawer.​​Add​​‘​react-native-drawer react-native-drawer​​‘ ‘​​​​​​module​​in​​the​​app. Create​​a​​component​​say​​​App App​​​​Navigator Navigator​​​​​​​​and​​call​​it​​from​​MainApp​​component.​​Add​​Drawer     

  5.   and​​Routes​​in​​this​​component.      

  6.   READ​ ​MORE​ ​ON​ ​OUR​ ​WEBSITE     ​ ​   Skyward​​Softwares​​&​​Solutions.  74,city​​centre,Ahmedabad-380009     

More Related