react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

Doesn't support React 18?

Open punit1108 opened this issue 2 years ago • 15 comments

I tried to install the library in one of my applications, which runs on react 18. But i got the following error -

Screenshot 2023-01-20 at 11 35 40 AM

Does it not support React 18?

punit1108 avatar Jan 20 '23 06:01 punit1108

same here

ralcant avatar Jan 25 '23 22:01 ralcant

It working via --legacy-peer-deps npm switch.

ornic avatar Jan 26 '23 13:01 ornic

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

Dilven avatar Feb 02 '23 07:02 Dilven

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

This is not working for me. I am still getting the same error.

kdesmondfaa avatar Feb 17 '23 12:02 kdesmondfaa

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

This is not working for me. I am still getting the same error.

did you update your version of npm, overrides was added in v8.3.0 https://stackoverflow.com/a/70396201

DustinKLo avatar Mar 11 '23 07:03 DustinKLo

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

This is not working for me. I am still getting the same error.

did you update your version of npm, overrides was added in v8.3.0 https://stackoverflow.com/a/70396201

Hey thanks, I was on v8.1

kdesmondfaa avatar Mar 13 '23 12:03 kdesmondfaa

please try https://github.com/Himself65/data-viewer

himself65 avatar Mar 19 '23 04:03 himself65

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

Unfortunately, this doesn't work if react-json-view is in npm workspace.

luixo avatar Mar 24 '23 15:03 luixo

I also couldn't fix with --legacy-peer-deps.

fatihyildizhan avatar Apr 11 '23 12:04 fatihyildizhan

+1

le-phone avatar Apr 25 '23 14:04 le-phone

+1

Draym avatar Apr 26 '23 08:04 Draym

Hey there! You might want to give this one a try: https://github.com/YYsuni/react18-json-view

image

YYsuni avatar Apr 27 '23 03:04 YYsuni

Github: https://github.com/uiwjs/react-json-view Website: https://uiwjs.github.io/react-json-view

react-json-view react-json-view image

Size and dependencies

Here is the size benchmark (using bundlephobia.com) against similar React libraries (found by npmjs.com/search):

Library Bundle size Bundle size (gzip) Deps Last commit
@uiw/react-json-view GitHub last commit
react-json-view-lite GitHub last commit
react-json-pretty GitHub last commit
react-json-inspector GitHub last commit
react-json-tree GitHub last commit
react-json-view GitHub last commit
react-json-tree-viewer GitHub last commit
react-domify GitHub last commit
react18-json-view GitHub last commit

jaywcjlove avatar Jun 20 '23 07:06 jaywcjlove

Hey there! You might want to give this one a try: https://github.com/YYsuni/react18-json-view

Look, I have added an editable feature and updated icons. Please feel free to submit an issue if you encounter any problems.

image

YYsuni avatar Aug 23 '23 13:08 YYsuni

It working via --legacy-peer-deps npm switch.

a better solution is to override this in package.json

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-json-view": "^1.21.3"
  },
  "overrides": {
    "react-json-view": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

@Dilven Thank you very much for sharing this solution. Saved my deploy from a frontend competition 😅

Kecbm avatar Nov 01 '23 01:11 Kecbm