Closed joeldenning closed 4 years ago
I managed to reproduce this bug on single-spa apps with /
somewhere in the appName (ex: @react-mf/people
).
I think the culprit is how the ":appName" is handled in react router:
Dynamic route for test app definition
<Route path="/app/:appName" component={TestApp} />
How links to this route is being generated
<Link
to={`/app/${applications[0].name}`}
className="primary button"
>
Next step: test it out
</Link>
Interpolating the to
prop will result in /app/@react-mf/people
where :appName will be mapped to @react-mf
instead of @react-mf/people
which is actually defined in the import-map
!
My proposed solution is to URI encode this appName and decode when TestApp page needs to get the appName from URL
👍 thanks for the fix.
Reported by Steve Back