Public
Edited
May 2, 2023
2 stars
Insert cell
Insert cell
<div id="root" style="width: 200px; height: 200px">
Loading...
</div>
Insert cell
{
function Demo(props) {
return React.createElement(
Smile, { style: { width: 100, height: 100 }}
);
}
root.render(React.createElement(Demo));
}
Insert cell
root = {
const container = document.getElementById('root');
return createRoot(container);
}
Insert cell
Smile = (await importWithMap("react-feather", importMap)).Smile
Insert cell
createRoot = (await importWithMap("react-dom/client", importMap)).createRoot
Insert cell
ReactDOM = await importWithMap("react-dom", importMap)
Insert cell
React = await importWithMap("react", importMap)
Insert cell
importMap = ({
imports: {
"react": "https://esm.sh/react@18.2.0?dev",
"react-dom": "https://esm.sh/react-dom@18.2.0?dev",
"react-dom/client": "https://esm.sh/react-dom@18.2.0/client?dev",
"prop-types": "https://esm.sh/prop-types@15.8.1?dev",
"react-feather": "https://unpkg.com/react-feather@2.0.10/dist/index.js"
},
});
Insert cell
importWithMap = (await import('https://unpkg.com/dynamic-importmap@0.0.1')).importWithMap
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more