Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a simple upgrade for React Navigation. There is one change that I had to make for types in our
getCurrentRoute()
function, which is supposed to return whatever the current route's name is.Right now we have
state
parameter as non-optional - and the oldreact-navigation
types allowed for this. However, in reality - particularly on web - it is in fact possible for state to beundefined
, and it seems that the latest react-navigation has fixed this type problem.The current behavior that we use is to assume that
Home
is the route we are on ifname
is undefined. This makes sense, since if you were to somehow land on a page that has no navigation state and we wanted to "send you back to a working page", that page would beHome
.I want to read a little more though in our code to see if this is a perfect assumption, there might be some case where it doesn't work.