This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using this PR to share the issues I've had integrating US Form System (USFS) within React-Static.
The main issue is that React-Static uses React v16 and react-router-dom v4 for routing while USFS depends on react-router v3 and React 15. USFS is currently discussing how they might remove this dependency, but that is a fresh discussion.
This manifests itself as a problem is in various forms.
One is that the
history
library which gets used by react-router has similar breaking changes b/t its v3 and v4. When trying to pass the Router the browser history, this results in errors likes:Another way the problems arises is when you follow the example in the starter app, the way they suggest you pass the routes to the Router component as a child doesn't work for our version of React. It seems like there is an incompatible pattern where you used to be able to pass a "plain route object" to a Router and it would compose the Route component from the object, but this seems incompatible with React 16. I would see errors that React doesn't accept objects sandwiched within JSX components/elements as children. Stackoverflow
By pulling in pieces of the USFS codebase and trying to make modification to the
FormApp
component, I tried to manually re-create the routing but I kept hitting dead ends.For example, in the screenshot above, I couldn't figure out how to pass the element I have highlighted the right
children
data. It seems to expect a Symbol.So after all of this, here are the 4 options I see moving forward...
cc/ @amenity @briaguya @ifsimicoded