Next.js: Possible spelling mistakes

Created on 21 Oct 2018  路  6Comments  路  Source: vercel/next.js

Bug report

Describe the bug

In the readme.md, at 'Routing | Intercepting popstate' section
There is a describe 'If you return a falsy value from beforePopState'

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to 'https://github.com/zeit/next.js#intercepting-popstate'
  2. Search 'falsy'
  3. See error

Expected behavior

I suppose it should be changed from
If you return a falsy value from beforePopState
to
If you return a false value from beforePopState

Screenshots

falsy

Most helpful comment

This isn't a typo is it? A falsy value is a value that is considered false when encountered in a Boolean context: https://developer.mozilla.org/en-US/docs/Glossary/Falsy

All 6 comments

Feel free to send a pull-request 馃槃

This isn't a typo is it? A falsy value is a value that is considered false when encountered in a Boolean context: https://developer.mozilla.org/en-US/docs/Glossary/Falsy

Yes @EdenLiang falsy is a valid term not a typo.

It appears we're going to be rewriting this anyway, according to @timneutkens in https://github.com/zeit/next.js/pull/5513

IMO this issues should be closed. The sentence 'If you return a falsy value from beforePopState' is perfectly valid.

Falsy is the opposite of truthy. These are proper terms in JS. They are distinct from false and true. Falsy values act like false in if statement, and truthy values act like true in if statements.

It seems a change has been merged that changes this https://github.com/zeit/next.js/pull/5513/files

IMO that phrasing

If you return a `false` value from `beforePopState`, `Router` will not handle `popstate`

is overly verbose, and could be simplified to

If you return `false` from `beforePopState`, `Router` will not handle `popstate`
Was this page helpful?
0 / 5 - 0 ratings