I’ve been following Elm from somewhat of a distance for a while, but I’m starting to put some effort into a gradual migration proposal for using Elm at work. We’re currently using React + ReactRouter to create a single page app. I understand it’s very easy to write a piece of the UI in Elm and then render it as a React component. But I’m trying to figure out where one goes from there.
As the Elm code takes over more surface area from React, it’s going to need to start handling routes on its own. But I can’t tell if that’s possible without upgrading to a Browser.application. My first thought was that I could have an Elm Browser.application and my ReactRouter code and let them handle different routes. I’d render the Elm app in a different div and use classes to hide the UI that is inactive. I quickly discovered, though, that Browser.application takes over the entire body, not just the DOM node provided, so this is a no go.
Has anyone successfully done a gradual migration from something like ReactRouter to an Elm SPA?