ajsmth / earhart Goto Github PK
View Code? Open in Web Editor NEWreact native + routing
react native + routing
So I think a common use case will be to have tabs that don't animate, I started creating a whatsapp clone to test this out a few weeks ago and noticed this. Also I think explaining how deep routing into nested navigators are intended to work would be quite handy as it's the only real complex concept.
For example, I may have a couple screens that can exist in tab a and tab b, if I want to deep link either on startup or clicking a push notification etc it seems that rather than explicitly setting tab this is clever and knows how to navigate sub Navigators?
Loving this so far, found a slight gotcha with this:
Popping to the root is not possible unless the initial path is "/"
const history = useHistory();
history.go(-history.entries.length)
Digging through the code, I think this is due to how the memoryHistory is behaves by default. It looks like given the following router treats the initial path is always set to "/"
With the following Navigator the memoryHistory is created incorrectly
<Navigator initialIndex={0}>
<Stack>
<Route gestureEnabled path="/1">
<Header titleColor="#ffffff" largeTitle titale="Test"
backgroundColor="transparent"/>
<Home />
</Route>
<Route gestureEnabled path="/2">
<Header titleColor="#ffffff" largeTitle title="Test2"
backgroundColor="transparent"/>
<Home />
</Route>
<Route gestureEnabled path="/3">
<Header titleColor="#ffffff" largeTitle title="Test3"
backgroundColor="transparent"/>
<Home />
</Route>
</Stack>
</Navigator>
However given the following markup the router behaves fine
<Navigator initialIndex={0}>
<Stack>
<Route gestureEnabled path="/">
<Header titleColor="#ffffff" largeTitle titale="Test"
backgroundColor="transparent"/>
<Home />
</Route>
<Route gestureEnabled path="/2">
<Header titleColor="#ffffff" largeTitle title="Test2"
backgroundColor="transparent"/>
<Home />
</Route>
<Route gestureEnabled path="/3">
<Header titleColor="#ffffff" largeTitle title="Test3"
backgroundColor="transparent"/>
<Home />
</Route>
</Stack>
</Navigator>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.