Skip to content

Dynamic filename issue #36

@samyoungnyc

Description

@samyoungnyc

I am trying this library because I have not been able to dynamically import markdown files successfully using create-react-app. I am trying to avoid ejecting.

I saw a snippet on this thead: facebook/create-react-app#3722

I am trying to load markdown files dynamically based on a prop lang like so:

const markdown = raw(`./${lang}About.md`);
setView(markdown);

I get the following error:

raw.macro: There was a problem evaluating the value of the argument for the code: raw(./${lang}About.md). If the value is dynamic, please make sure that its value is statically deterministic. Learn more:

What this error is saying is puzzling to me. If setting a path like this is not possible I understand, however if this is something that should be possible another way, would love to know how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions