Share a React component as a link, no build step
Claude and other AI tools often hand you a React component as a .jsx file. Wrap it in one HTML file that loads React and compiles the JSX in the browser, then upload it and send the link.
A .jsx file is source code, not a page. Opened on its own, a browser shows the text or downloads it. It needs three things around it to run: React itself, a way to turn JSX into JavaScript, and an HTML page with an element to render into.
All three fit in one HTML file. No npm, no bundler, no deploy.
The wrapper
Create a file called app.html with this structure, and paste your component where the comment says:
- ✓In the head, an import map that tells the browser where each import lives: <script type="importmap">{ "imports": { "react": "https://esm.sh/react@18.3.1", "react-dom/client": "https://esm.sh/react-dom@18.3.1/client" } }</script>
- ✓Below it, Babel to compile JSX in the browser: <script src="https://unpkg.com/@babel/standalone@7.26.4/babel.min.js"></script>
- ✓In the body, <div id="root"></div>, then <script type="text/babel" data-type="module" data-presets="react"> containing your component code.
- ✓At the end of that script, mount it: import { createRoot } from 'react-dom/client'; at the top, and createRoot(document.getElementById('root')).render(<App />); at the bottom, using your component's name.
- ✓Keep import React from 'react' as the first import. The in-browser compiler turns JSX into React.createElement calls, and without that line the page fails with "React is not defined".
Components that import other packages
AI-written components often import icon or chart libraries. Add each one to the import map with ?external=react on the end, so it uses the same copy of React as your component:
- ✓"lucide-react": "https://esm.sh/lucide-react@0.383.0?external=react"
- ✓Pin a version in every URL so the page does not change when a package releases one.
- ✓Tested in Chrome: a component using useState and a lucide-react icon rendered, and its click handler updated the count.
- ✓Styling with Tailwind class names needs the Tailwind script too: sharing a Tailwind page as a link.
When to use a build instead
Compiling in the browser adds a short delay on load, and Babel prints a console warning that it is meant for development. For one component sent to a few people, that is usually fine. For a multi-file app with its own package.json, build it into a single file with Vite instead: sharing a Vite or React app as a single HTML file.
Upload it and send the link
Drag app.html onto the FileShare Pro dashboard and copy the link. Viewers need no account.
Turn on comments and reviewers can pin notes to parts of the page after typing a name. When the AI tool gives you a new version, paste it into the same wrapper and upload it over the old one; the link stays the same: updating a shared link without changing it.
Related: sharing a Claude artifact and why an AI page works in chat but breaks when hosted.
Frequently asked
Browsers run HTML and JavaScript, not JSX. The file needs an HTML page around it that loads React and compiles the JSX, as in the wrapper above.
The in-browser compiler turns JSX into React.createElement calls. Add import React from 'react' at the top of the component.
Yes. Double-click app.html; in Chrome the wrapper runs from your computer the same way it runs at the link, as long as you are online for the CDN files.
Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free