mirror of
https://github.com/c8r/x0.git
synced 2024-08-17 01:10:32 +03:00
Merge pull request #95 from c8r/use-mdx-skip-export
Use skip export option in mdx
This commit is contained in:
commit
3257d12754
@ -12,10 +12,7 @@ import styled from 'styled-components'
|
|||||||
import mdx from '@mdx-js/mdx'
|
import mdx from '@mdx-js/mdx'
|
||||||
|
|
||||||
const transformCode = src => `<React.Fragment>${src}</React.Fragment>`
|
const transformCode = src => `<React.Fragment>${src}</React.Fragment>`
|
||||||
const transformMdx = src => {
|
const transformMdx = src => mdx.sync(src, { skipExport: true })
|
||||||
const code = mdx.sync(src)
|
|
||||||
return code.replace(/^(\s)*export default \({components}\) =>/, '')
|
|
||||||
}
|
|
||||||
|
|
||||||
const Preview = styled(LivePreview)([], {
|
const Preview = styled(LivePreview)([], {
|
||||||
padding: '16px',
|
padding: '16px',
|
||||||
|
Loading…
Reference in New Issue
Block a user