I’m now stuck at the component registration process … where/how can I get help ?
Hi Icaro.
I don’t know what to do to execute this
I’m using javascript and not typescript so I suppose that I must create a plasmic-init.js file ?
Where should I put it ?
Are you integrating with an already existing project or are you creating a brand new project?
What I have done:
- create-react-app
- Install React Router
- Synchronise with plasmic project
- Create the route for /plasmic-host
- Configure my project with route url
- Install Material UI library
Now I try to register the MUI Components I would like to use in Plasmic Studio
All is in Javascript
You can register your components inside the plasmic-host
file, like this:
// You can register any code components that you want to use here; see
// <https://docs.plasmic.app/learn/code-components-ref/>
// And configure your Plasmic project to use the host url pointing at
// the /plasmic-host page of your nextjs app (for example,
// <http://localhost:3000/plasmic-host>). See
// <https://docs.plasmic.app/learn/app-hosting/#set-a-plasmic-project-to-use-your-app-host>
// registerComponent(...)
export default function PlasmicHost() {
return <PlasmicCanvasHost />;
}
Is the file already existing ? if yes in which folder ?
Oh, inside the route that you created plasmic-host
(no content)
const root = ReactDOM.createRoot(document.getElementById(‘root’));
root.render(
<React.StrictMode>
<Route path=“/” element={} />
<Route path=“/plasmic-host” element={} />
</React.StrictMode>
);
Oooh, sorry.