Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

Unable to use UI components (OpenApiCodeSample) when using LandingLayout page template in .mdx file #203

@bjonesy

Description

@bjonesy

I was building out a .mdx page and wanted to use the LandingLayout page template. When I use this template the OpenApiCodeSample will error with Incorrect definitionId:. If I remove using the template then it works just fine.

Screen Shot 2022-04-25 at 10 56 09 AM

Can I use the LandingLayout or do I need to create another template instead?

.mdx file

---
title: Demo Customization
---

import { LandingLayout, OpenApiCodeSample } from '@redocly/developer-portal/ui';

<OpenApiCodeSample
definitionId="betterCloudApi"
operationId="get_v1_tokens_lookup"
defaultLanguage="Java"
/>
	
export default LandingLayout;

Whether I move the export default LandingLayout; to the top or bottom of the page I get the same error. I noticed in the index.mdx file that the import is at the top https://github.com/Redocly/developer-portal-starter/blame/main/index.mdx#L27

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions