Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support alternative container via as prop #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amoshydra
Copy link

@amoshydra amoshydra commented Jun 5, 2024

Summary

Provide a new prop as allowing container to be switched out to a user provided React.ElementType or React.ComponentType

Related to

Related to #110

How is this tested?

image

Tested with the following code snippet (This is not included in this PR / documentation change)

import React from "react";
import Lottie from "../../../src/components/Lottie";
import groovyWalkAnimation from "../../assets/groovyWalk.json";

const LottieAsExample = () => {
  return (
    <button>
      <Lottie
        animationData={groovyWalkAnimation}
        autoplay={true}
        as="span"
        style={{ display: 'inline-block', width: "2rem" }}
        data-testid="loading-graphic"
      />
      Loading
    </button>
  );
};

export default LottieAsExample;

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant