-
I have no access to JSX, just assume I'm using esm.sh how would I create a chart? |
Beta Was this translation helpful? Give feedback.
Answered by
Kreijstal
Nov 25, 2024
Replies: 1 comment 4 replies
-
What is esm.sh? Recharts is a react library, you cannot use it without JSX |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I apologize for my harsh tone earlier - that wasn't constructive.
While Recharts is indeed a React library, it's important to note that JSX is not a requirement for using React - it's just syntactic sugar that gets transformed into JavaScript. React can be used with plain JavaScript calls to
React.createElement()
or similar factory functions.I've created a working example demonstrating Recharts usage without JSX here: https://observablehq.com/@kreijstal/rechart-without-build-system
For those unfamiliar, esm.sh is a CDN that provides ESM versions of npm packages, allowing direct usage in browsers without a build system. This can be particularly useful for prototyping or environments where…