Comments (13)
Hey @Theo-Taylor we took a different route and added docking capabilities to a fork of react-native-drawer-layout that added push/displace/slide drawers (added docking in another fork of that fork) and then exposed those in a fork of react-navigation's DrawerNavigator.
- Our fork of react native drawer layout
- Our fork of react navigation which uses the changes introduced above
Basically you pass a drawerType='responsive' and a breakpoint in drawerResponsiveWidth at which it will dock or go back to being a push screen drawer (like twitter mobile).
We'll eventually PR these I think, but for now it's up there if it's of interest.
from rfcs.
Very basic implementation:
https://github.com/theo-taylor/basic-react-navigation-sidebar
from rfcs.
@jpstrikesback hey awesome!
This was like a proof of concept for us and we haven't been able to do much work on it since. But if you are interested in collaborating to make a custom navigator out of it we'd be happy to work with you!
from rfcs.
@jpstrikesback interesting, it seems plausible. Shoot me an email at [email protected], let's discuss how we can proceed.
from rfcs.
hey @Theo-Taylor! very cool stuff. we don't want to add more navigators to the core of react-navigation, we're actually going the opposite direction and plan on moving out as many as we can. but we're hoping that more folks like you build navigators to solve various use cases like this! we can have a directory for them inside of the docs
from rfcs.
@brentvatne awesome! I like the directory idea
from rfcs.
@Theo-Taylor this looks awesome!
Any chance you could share your code? We're about to experiment with iPad/Desktop nav and need split-screen/panes as well.
from rfcs.
@Theo-Taylor Sweet! Definitely interested! I want to be able to use navigation actions to show/hide but also change the content in side panes (dual and triple pane). And then be able to integrate that with linking for deep links and the web.
From your experience does that sound reasonable?
Cheers!
JP
from rfcs.
Hey @jpstrikesback, I'll definitely check them out
from rfcs.
cool stuff @Theo-Taylor!
from rfcs.
@Theo-Taylor did you ran into the following problem?
When I click on an item in the left navigation screen the right details screen is showing up. Everything is ok. When the right details screen is scrollable I scroll down a bit. Everything is ok.
But when I am changing now the right details screen with clicking on a new item left, the right screen stays at the same scroll position.
So an user wonders why the content is changing or even don't recognize that, because the scroll position stays the same.
I am thinking of managing some scroll to top after navigating somehow, but didn't figure out yet.
You got it?
from rfcs.
@donni106 hey, I haven't come across that issue
Can you share some more details?
Are the root views of the details screens ScrollViews?
Or are they wrapped in a normal View?
from rfcs.
@Theo-Taylor I managed to fix it for my case with a work around.
The right details screen is a ScrollView wrapped inside nested Views.
A simple prototype:
<View>
<View navigation={navigation} /> // <-- left sidebar
<View>
<ScrollView navigation={descriptor.navigation} /> // <-- right details screen
</View>
</View>
Somehow the real navigation is not done, only contents were changed.
When a user clicked somewhere left while scrolled down right, the right screen scroll position was kept.
I am navigating with:
return navigation.navigate({
routeName: navigateTo,
key: `${navigateTo.toLowerCase()}-${item.id}`,
action: NavigationActions.navigate({
routeName: navigateToAction,
params: navigateItem
});
}}
Now a hard stack reset with navigation is done to properly reset the right screen:
return navigation.navigate({
routeName: navigateTo,
key: `${navigateTo.toLowerCase()}-${item.id}`,
action: StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({
routeName: navigateToAction,
params: navigateItem
})
]
});
}}
from rfcs.
Related Issues (20)
- Action property that indicates to routes that they should not change index HOT 1
- Improve ergonomics of back HOT 1
- Navigator config to pass params down HOT 1
- Add unsetParams to navigation prop HOT 2
- Reset state action HOT 2
- Expose logic for initializing state of createAppContainer HOT 4
- On will/didFocus subscribe, stop firing the listener if current screen is focused HOT 2
- Idea: Preloading HOT 6
- <StaticNavigator> for tests/storybook HOT 14
- StackActions.popToRouteName(routeName) HOT 2
- Alternative API for defining navigators HOT 12
- how to send navigation events between peer navigators? HOT 4
- Deep linking with authentication
- How to hide tab bar item n react-navigation HOT 3
- Ability to show screens on top of native modals
- useNavigationParams hook HOT 1
- Add useMaterialTabsHeight HOT 1
- Typesafe Stack & Navigation HOT 1
- devTools prop HOT 5
- [RFC] TabView API change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfcs.