hookrouter icon indicating copy to clipboard operation
hookrouter copied to clipboard

If setBasepath isn't called null in the routes will have strange results

Open Zache opened this issue 6 years ago • 0 comments

If you don't call setBasepath, then the basePathRegEx will be null var basePathRegEx = null;

This will result in strange behavior because of string coercion, you can check like in this StackOverflow question

I've identified the following problems:

  1. Routes that contain the string null will never match
  2. Routes not containing the string null can have have it added once and still match
  3. The usePath hook will not return the correct path if the current path contains the string null

Zache avatar Nov 22 '19 09:11 Zache