Unable to use Redirect as a component
Opened this issue · 1 comments
steinybot commented
It is a little hard for me to nail down exactly what the problem is since I am using Scala.js with ScalablyTyped bindings for found but this is what I am seeing:
It seems that React thinks that the Redirect component is a class component and is calling render
with no arguments.
There are some pretty suspicious comments on Redirect.tsx about it trying to trick the consumer into thinking it is a React.Component which seem relevant.
steinybot commented
Ah I managed to reproduce it without Scala.js.
Here is what does not work:
{
path: 'baz2',
Component: () => <Redirect to='/foo'/>
}
The way it gets used in the example of:
new Redirect({
from: 'baz',
to: '/foo',
}),
is pretty strange IMO. I much prefer to stick to the route object way of configuring it.