react-navigation / react-navigation/react-navigation.github.io

Documentation missing for canGoBack()

Open
#724 2 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
324
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Current Behavior

According to @satya164 in react-navigation/react-navigation#7814 we should use canGoBack() to guard against going back too much. If we don't, it'll result in a console.error() being emitted (red screen).

canGoBack is an undocumented feature. It's only mentioned in passing in the 'upgrading from 3.x' article where it's mentioned as a feature on the HeaderBackButton, however the function is (also?) available on the navigator object.

Screen Shot 2020-03-18 at 11 36 36

Expected Behavior
Typing "canGoBack" in search field in the documentation should yield this result.

How to reproduce

  1. Open https://reactnavigation.org/docs
  2. Type "canGoBack" in upper right search field

** Other comments **

It may make sense to reference the new documentation for canGoBack() in relation to goBack(), pop(), jumpTo(), and popToTop().

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching the documentation for the existing references to canGoBack(), goBack(), pop(), jumpTo(), and popToTop(). Add a searchable canGoBack() entry explaining its availability and guarding purpose, with links to the related navigation methods; done means searching the documentation for canGoBack returns the new explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, react-native
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.