Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

refactor: add a type property to router and state #146

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

satya164
Copy link
Member

The type property denotes the type of the router. It can be used to verify compatibility of navigation state and the router when rehydrating state, making rehydration more resilient.

It can also help our utilities to detect the type of the navigator to properly implement some functionality. For example, the useScrollToTop hook can now know if it's not inside a tab navigator and needs to find the tab navigator in a parent.

The `type` property denotes the type of the router. It can be used to verify compatibility of navigation state and the router when rehydrating state, making rehydration more resilient.

It can also help our utilities to detect the type of the navigator to properly implement some functionality. For example, the `useScrollToTop` hook can now know if it's not inside a tab navigator and needs to find the tab navigator in a parent.
@codecov-io
Copy link

Codecov Report

Merging #146 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
+ Coverage    93.6%   93.65%   +0.05%     
==========================================
  Files          36       36              
  Lines         751      757       +6     
  Branches      197      199       +2     
==========================================
+ Hits          703      709       +6     
  Misses         39       39              
  Partials        9        9
Impacted Files Coverage Δ
...ges/core/src/__tests__/__fixtures__/MockRouter.tsx 88.57% <ø> (ø) ⬆️
packages/routers/src/StackRouter.tsx 96.96% <ø> (ø) ⬆️
packages/routers/src/TabRouter.tsx 96.96% <ø> (ø) ⬆️
packages/core/src/useNavigationBuilder.tsx 98.76% <100%> (+0.06%) ⬆️
packages/routers/src/DrawerRouter.tsx 96.55% <100%> (ø) ⬆️
packages/core/src/useNavigationCache.tsx 96.29% <0%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a77107...3276ca7. Read the comment docs.

@osdnk osdnk merged commit 3d9db6f into master Oct 30, 2019
@osdnk osdnk deleted the @satya164/router-type branch October 30, 2019 11:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants