Skip to content

Update react peer dependency version #5

@Saturn-V

Description

@Saturn-V

Hello.

I am looking to get jotform-react to installed on a nextJS 13 based react application, within a monorepo using npm workspaces. My react application depends on react@18/react-dom@18, so naturally I get a dependency resolution error trying to install jotform-react since it defines react-react-dom as peer dependencies as follows "react": "^17.0.2 | ^16.13.1".

I would usually define an overrides field to my application's package.json to resolve this. Unfortunately, it seems like support for overrides when using npm workspaces is either non existent or unreliable. I'm not sure what else to try when it comes to trying to override the react/react-dom dependencies of jotform-react, however I am still looking into things. The alternative solution would be to add react/react-dom@18 to the peer dependencies ("react": "^18.2.0 | ^17.0.2 | ^16.13.1" or "react": ">= 16.13.1").

I'd rather not fork this repo over to do this. Is it possible to add this change to jotform-react? Happy to make the PR for it if needed.

I am currently using react-jotform-embed, which has it's own issues around using a class based form component. It seems to do the job decently enough for the time being. jotform-react seems like the better option though, so I'd like to use it instead.

Are we able to introduce the following peer dependencies change to jotform-react's package.json?

"peerDependencies": {
    "react": ">= 16.13.1",
    "react-dom": ">= 16.13.1"
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions