Bring custom code or other React libraries
Last updated
Last updated
JSX.Design allows you to bring custom code or other React libraries into your canvas even if specific components aren’t directly supported by the editor.
With the Portal component, you can inject any custom code you need and see it reflected in your IDE's preview.
The Portal component in JSX.Design makes it easy to embed custom code without needing to modify the exported code manually. Here’s how to do it:
Open your canvas in JSX.Design.
Add the Portal component to your canvas.
Navigate to Props tab on the right sidebar. Assign an Elem ID to the Portal component, for example, portal1
.
Once you’ve added the Portal component, export your project’s code from JSX.Design and open it in your IDE.
To add custom code simply inject your code directly using the portalId_children
in your IDE:
The JSX.Design editor will not render the third-party component or custom code. However, the output in your React application will display the updated content.
This approach works for any React library or custom component, giving you unparalleled flexibility.
Great! Now get ready to build the most advanced UIs with eject.
See: