Skip to content

Commit 44b5809

Browse files
authored
Merge pull request #52 from LottieFiles/develop
feat(window): added lottie to the window object
2 parents 15db120 + f587f7f commit 44b5809

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Player.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ export function parseSrc(src: string | object): string | object {
2525
return src;
2626
}
2727

28+
// Necessary so that we can add Lottie to the window afterwards
29+
declare global {
30+
interface Window {
31+
lottie: any;
32+
}
33+
}
34+
2835
// Define valid player states
2936
export enum PlayerState {
3037
Loading = 'loading',
@@ -103,7 +110,7 @@ export class Player extends React.Component<IPlayerProps, IPlayerState> {
103110

104111
constructor(props: IPlayerProps) {
105112
super(props);
106-
113+
window.lottie = lottie;
107114
this.state = {
108115
animationData: null,
109116
background: 'transparent',

0 commit comments

Comments
 (0)