Skip to content

How to handle dynamic imports #19

@iDVB

Description

@iDVB

Question: How should we handle dynamically importing in a directory of images?

Eg. This first one would fail, where the second one would succeed.

  const stuff = "tree.jpg";
  const stuff2 = "?sizes=375";

   return (<Picture
        src={[
          require(`../assets/images/${stuff}${stuff2}`),
          require(`../assets/images/${stuff}`),
        ]}
        breakpoints={[768]}
      />)

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