Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Variable definition in MDX broken when referenced in Playground #1247

@Dangoo

Description

@Dangoo

Bug Report

The MDX docs state one should be able to declare variables within the MDX document through export like so:

import { Playground } from 'docz';

export const myVariable = 'Yay!'
# Hello, world!
<Playground>
  <div>{myVariable}</div>
</Playground>

To Reproduce

  1. create-docz-app my-docz-app && cd my-docz-app
  2. Change src/index.mdx to above example
  3. Run npm run docz dev
  4. See error in browser:
❌ Uncaught ReferenceError: myVariable is not defined

Expected behavior

It should render <div>Yay!</div> and variable myVariable should be available in Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions