Hi there! I’ve been using FlowRouter successfully for a couple years now. However, in light of React 16’s changes, I’m slowly converting all my components from React.createClass to extends React.Component. Doing this on components mounted via FlowRouter seems to cause all sorts of issues though. Here’s an example:
Not a React expert, but in this thread, I was trying to answer the similar question.
Earlier we added, yet undocumented, React Composer helpers - see this thread.
Can’t help you with the error, but hope you will find some clue in the links above.
Exact same problem, unfortunately. As soon as I switch the component from export default Terms = React.createClass({ to export default class Terms extends React.Component { it stops working.
If I use React.createClass, everything works fine. If I change it to React.Component then I get Uncaught (in promise) ReferenceError: Terms is not defined. One possible I read was that react-mount might only be able to handle stateless components… so I tried to just do a simple export const Terms = () => {return <div>Hello</div>} but had no luck with that either.
Can’t help you with React, haven’t used it.
Hope other folks will help you. Or you can ask it on the React GitHub rep. This is definitely React specific question.
Okay, at least import is importing now. React.createElement is 100% React specific now.
Keep this thread updated - I would like to add working example to FlowRouter docs
That one works if I use export default Terms = React.createClass, but again fails with export default class Terms extends React.Component with the error Uncaught (in promise) ReferenceError: Terms is not defined
Apologies, I was wrong. I hadn’t properly implemented your code (was accidentally overriding the route). Turns out the only thing I needed to do differently in yours was to do content: <Terms /> instead of content: () => <Terms />.