Conversation
| Asset.loadAsync(StackAssets); | ||
|
|
||
| export default function App() { | ||
| const containerRef = React.useRef<NavigationContainerRef>(React.createRef()); |
There was a problem hiding this comment.
You don't need to pass createRef into useRef, we can pass null and use the returned ref instead of .current
| ); | ||
| } | ||
|
|
||
| wasStateModified.current = true; |
There was a problem hiding this comment.
shouldn't we check if state actually changed?
| "eject": "expo eject" | ||
| }, | ||
| "dependencies": { | ||
| "@navigation-ex/native": "^0.0.1", |
There was a problem hiding this comment.
I think this will create a symlink, right? if just add it to the eslint config in root
| if (castedRef.current !== null) { | ||
| castedRef.current | ||
| .dispatch({ type: 'GO_BACK' }) | ||
| .then((wasHandled: boolean) => { |
|
I have another thought. This wouldn't be a problem for us if we had a some kind of When you call this method, it'll recursively call parent Similar to how the root container's Now we can check this method in our container and only dispatch a back action if we can go back. No messing with how state updates, no returning promise from dispatch etc. |
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
==========================================
+ Coverage 96.3% 96.31% +<.01%
==========================================
Files 24 24
Lines 406 407 +1
Branches 87 87
==========================================
+ Hits 391 392 +1
Misses 14 14
Partials 1 1
Continue to review full report at Codecov.
|
satya164
left a comment
There was a problem hiding this comment.
It's a bit hard to review with both changes in this PR. Can you rebase your PR and squash the commits so that there is a single commit for changes made only in this PR which I can easily review?
Or let's get the other PR merged first and rebase.
|
|
||
| export { useBackButton }; | ||
|
|
||
| export default function useNativeIntegration(ref: NavigationContainerRef) { |
There was a problem hiding this comment.
move the hook to separate file since we only re-export in index files everywhere
| listeners[0](navigation => navigation.dispatch(action)); | ||
|
|
||
| React.useImperativeHandle(ref, () => ({ | ||
| performOnFocusedNavigator: ( |
There was a problem hiding this comment.
Don't think we want to expose performOnFocusedNavigator. The exposed ref should look like every other navigation object. We should expose canGoBack method instead where we internally perform this on focused navigator and return the result.
0883d97 to
e202be4
Compare
e202be4 to
a971f37
Compare
No description provided.