INNER CODE UNIT · TypeScript

toJsxNode

react/react-native-website · plugins/remark-snackplayer/src/index.ts:32

async function toJsxNode(node: Code) {
  const params = parseParams(node.meta ?? undefined);

  // Gather necessary Params
  const name = params.name ? decodeURIComponent(params.name) : 'Example';
  const description = params.description
    ? decodeURIComponent(params.description)
    : 'Example usage';
  const ext = params.ext ? decodeURIComponent(params.ext) : 'tsx';
  const filename = `App.${ext}`;
  const files = encodeURIComponent(
    JSON.stringify({
      [filename]: {
        type: 'CODE',
        contents: node.value,
      },
    })
  );

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…