Skip to content

Conversation

malor
Copy link
Member

@malor malor commented Jun 5, 2021

The new version of xsnippet-api uses alphanumeric slugs instead of integer identifiers, so we need to update the regex accordingly to work with all possible snippet id values.

The new version of xsnippet-api uses alphanumeric slugs instead of
integer identifiers, so we need to update the regex accordingly to
work with all possible snippet id values.
@malor malor requested review from lotrien and ikalnytskyi June 5, 2021 20:47
@malor malor merged commit a937493 into master Jun 6, 2021
@malor malor deleted the fix-snippet-route branch June 6, 2021 16:09
malor added a commit that referenced this pull request Jun 6, 2021
#159 accidentally broke
routing: apparently, React renders *all* matched routes by default,
and so our new snippet id regexp does not play nicely with other
routes like /about or /recent, which are now matched as well, because
both "about" and "recent" are valid snippet ids.

The solution is to use the https://reactrouter.com/web/api/Switch
component which renders the *first* matched Route as opposed to all
of them.
@malor malor mentioned this pull request Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants