c8r / x0

Document & develop React components without breaking a sweat

Home Page:https://compositor.io/x0/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LiveEditor with Custom Component/ScopeProvider example?

huy-qn opened this issue · comments

I am trying to use the LiveEditor from mdx with x0 but I'm having a hard time trying to make it work with my custom components. The document isn't clear about how to include it into the props scope.

Until now, I created a scope.js file like this

`import { Box } from 'rebass'

const scope = {
Box
}

export default scope`

then use it in the _app.js file like this
<ScopeProvider scope={scope}> </ScopeProvider>
But the LiveEditor is still not able to get that Box component. Am I missing something? Thank you!