🎥 Make videos programmatically with React
Merge branch 'main' into pr/515
Jonny Burgera4f365d24af4
diff --cc packages/player-example/src/CarSlideshow.tsxindex b5352d75fa,c98aeea57d..03326cf01b--- a/packages/player-example/src/CarSlideshow.tsx+++ b/packages/player-example/src/CarSlideshow.tsx@@@ -1,22 -1,12 +1,20 @@@- import { lazy } from 'react';++import {lazy} from 'react';import {interpolate, useCurrentFrame, useVideoConfig} from 'remotion';type Props = {- title: string,- bgColor: string,- color: string,- loading: Boolean+ title: string;+ bgColor: string;+ color: string;++ loading: boolean;};-- const TriggerLoading = lazy(() => {+-const CarSlideshow = ({title, bgColor, color}: Props) => {++const TriggerLoading = lazy(() => {+ return new Promise(() => () =>- import(- './trigger-loading'- ).then(() => () => null as never),++ import('./trigger-loading').then(() => () => null as never)+ );- });++});++const CarSlideshow = ({title, bgColor, color, loading}: Props) => {const frame = useCurrentFrame();const {width, height, durationInFrames} = useVideoConfig();const left = interpolate(frame, [0, durationInFrames], [width, width * -1]);@@@ -45,7 -35,6 +43,7 @@@>{title}</h1>- {loading && <TriggerLoading/>}++ {loading && <TriggerLoading />}</div>);};