How to mount react components with Flow Router in Meteor 3?

Our app uses Flow Router (before Khadira, now Ostrio) with React. However, the package we have used to mount React components so far, called react-mounter, was abandoned long ago and looks like it is incompatible with React 17 or Meteor 3 (or both). Is there any alternative package or method that we can use to keep using FlowRouter or must we completely switch to react-router?

1 Like

I switched all projects to react-router a longer time ago (Firstly from some another to FlowRouter and than later from FlowRouter to ReactRouter).

Maybe this will help: meteor-apm-server/client/components/0common/react/component.js at fe43bbc7e2625432f2eb785711f412f32d5ebd2b · lmachens/meteor-apm-server · GitHub

This might not be the answer you’re looking for but you might be interested is poon-router poon-router - npm this will help ease your transition because it uses a familiar global routing to flow-router and is its spiritual successor imo.

If you are using blaze for some reason, there is the blaze-react package. Truth is, you have to deal with a bit of boilerplate if you want to glue stuff together like flow router and react.

…by my experience, better is ref#ctor and use “most common/standard solution”.

Thank you. I think so too. I managed to get the react-mounter working by importing the package’s code directly into the codebase, but I believe in the future we will migrate to react-router. The refactoring process to migrate to react-router for our app will take a long time.

Hi @belfigue I was also thinking, that migration will take a long time, but when you will create a single route as a pattern and json with list of routers, it can be much faster, than expected.