Skip to content

🎥 Make videos programmatically with React

let's go

JonnyBurgerfc5426074d89
diff --git a/packages/transitions/src/TransitionSeries.tsx b/packages/transitions/src/TransitionSeries.tsx
index 1870e023ee..53bbfdf93e 100644
--- a/packages/transitions/src/TransitionSeries.tsx
+++ b/packages/transitions/src/TransitionSeries.tsx
@@ -12,6 +12,7 @@ import {
WrapInExitingProgressContext,
} from './context.js';
import {flattenChildren} from './flatten-children.js';
+import {HtmlInCanvasOverlay} from './html-in-canvas-presentation.js';
import {slide} from './presentations/slide.js';
import type {
OverlayMethods,
@@ -436,7 +437,6 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
const UppercaseNextPresentation = nextPresentation.component;
const UppercasePrevPresentation = prevPresentation.component;
- const RequiresOverlay = prevPresentation.overlay;
return (
<Sequence
// eslint-disable-next-line react/no-array-index-key
@@ -483,10 +483,10 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
</UppercasePrevPresentation>
</WrapInExitingProgressContext>
</UppercaseNextPresentation>
- {RequiresOverlay && (
- <RequiresOverlay
+ {nextPresentation.shader && (
+ <HtmlInCanvasOverlay
refToMethods={refToMethods}
- presentationProgress={nextProgress}
+ shader={nextPresentation.shader}
passedProps={nextPresentation.props ?? {}}
/>
)}
@@ -499,7 +499,6 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
const UppercasePrevPresentation = prevPresentation.component;
- const RequiresOverlay = prevPresentation.overlay;
return (
<Sequence
// eslint-disable-next-line react/no-array-index-key
@@ -529,11 +528,11 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
{child}
</WrapInEnteringProgressContext>
</UppercasePrevPresentation>
- {RequiresOverlay && (
- <RequiresOverlay
+ {prevPresentation.shader && (
+ <HtmlInCanvasOverlay
refToMethods={refToMethods}
- presentationProgress={prevProgress}
passedProps={prevPresentation.props ?? {}}
+ shader={prevPresentation.shader}
/>
)}
</Sequence>
@@ -545,7 +544,6 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
const UppercaseNextPresentation = nextPresentation.component;
- const RequiresOverlay = nextPresentation.overlay;
return (
<Sequence
// eslint-disable-next-line react/no-array-index-key
@@ -573,11 +571,11 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
{child}
</WrapInExitingProgressContext>
</UppercaseNextPresentation>
- {RequiresOverlay && (
- <RequiresOverlay
+ {nextPresentation.shader && (
+ <HtmlInCanvasOverlay
refToMethods={refToMethods}
- presentationProgress={nextProgress}
passedProps={nextPresentation.props ?? {}}
+ shader={nextPresentation.shader}
/>
)}
</Sequence>
diff --git a/packages/transitions/src/html-in-canvas-presentation.tsx b/packages/transitions/src/html-in-canvas-presentation.tsx
new file mode 100644
index 0000000000..c0b5922ce2
--- /dev/null
+++ b/packages/transitions/src/html-in-canvas-presentation.tsx
@@ -0,0 +1,202 @@
+import {
+ useImperativeHandle,
+ useLayoutEffect,
+ useMemo,
+ useRef,
+ useState,
+} from 'react';
+import type {EffectsProp} from 'remotion';
+import {
+ AbsoluteFill,
+ Internals,
+ useCurrentFrame,
+ useVideoConfig,
+} from 'remotion';
+import type {HtmlInCanvasShader} from './presentations/zoom-blur';
+import type {
+ MandatoryOverlayComponentProps,
+ TransitionPresentation,
+ TransitionPresentationComponentProps,
+} from './types';
+
+export const HtmlInCanvasPresentation: React.FC<
+ TransitionPresentationComponentProps<Record<string, unknown>>
+> = ({
+ children,
+ onElementImage,
+ onUnmount,
+ presentationProgress,
+ presentationDirection,
+}) => {
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+ const canvasSubtreeStyle: React.CSSProperties = useMemo(() => {
+ return {
+ width: '100%',
+ height: '100%',
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ };
+ }, []);
+
+ const presentationProgressRef = useRef(presentationProgress);
+ presentationProgressRef.current = presentationProgress;
+
+ useLayoutEffect(() => {
+ const canvas = canvasRef.current;
+ if (!canvas) {
+ return;
+ }
+
+ canvas.layoutSubtree = true;
+
+ const onPaint = () => {
+ const firstChild = canvas.firstChild as HTMLElement;
+
+ if (!firstChild) {
+ return;
+ }
+
+ const elementImage = canvas.captureElementImage(firstChild);
+ onElementImage(elementImage, presentationProgressRef.current);
+
+ const context = canvas.getContext('2d');
+ if (!context) {
+ throw new Error('Failed to get context');
+ }
+ };
+
+ canvas.addEventListener('paint', onPaint);
+
+ return () => {
+ canvas.removeEventListener('paint', onPaint);
+ };
+ }, [onElementImage, presentationDirection]);
+
+ useLayoutEffect(() => {
+ const canvas = canvasRef.current;
+ if (!canvas) {
+ return;
+ }
+
+ canvas.requestPaint?.();
+ }, [presentationProgress]);
+
+ useLayoutEffect(() => {
+ return () => {
+ onUnmount();
+ };
+ }, [onUnmount]);
+
+ return (
+ <AbsoluteFill>
+ <canvas ref={canvasRef} style={canvasSubtreeStyle}>
+ {children}
+ </canvas>
+ </AbsoluteFill>
+ );
+};
+
+export const HtmlInCanvasOverlay: React.FC<
+ MandatoryOverlayComponentProps<Record<string, unknown>>
+> = ({refToMethods, passedProps, shader}) => {
+ const {width, height} = useVideoConfig();
+ const [offscreenCanvas] = useState(() => new OffscreenCanvas(width, height));
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+
+ const frame = useCurrentFrame();
+ const frameRef = useRef(frame);
+ frameRef.current = frame;
+ const passedPropsRef = useRef(passedProps);
+ passedPropsRef.current = passedProps;
+
+ const [instance] = useState(() => shader());
+
+ useLayoutEffect(() => {
+ instance.init(offscreenCanvas);
+
+ return () => {
+ instance.cleanup();
+ };
+ }, [offscreenCanvas, instance]);
+
+ const chainState = Internals.useEffectChainState();
+
+ useImperativeHandle(refToMethods, () => {
+ return {
+ draw: (
+ prevImage: ElementImage | null,
+ nextImage: ElementImage | null,
+ progress: number,
+ ) => {
+ if (!canvasRef.current) {
+ return;
+ }
+
+ instance.draw({
+ prevImage,
+ nextImage,
+ width,
+ height,
+ time: progress,
+ passedProps: passedPropsRef.current,
+ });
+ offscreenCanvas.width = width;
+ offscreenCanvas.height = height;
+ Internals.runEffectChain({
+ state: chainState.get(width, height)!,
+ source: offscreenCanvas,
+ effects: passedPropsRef.current._experimentalEffects ?? [],
+ frame: frameRef.current,
+ width,
+ height,
+ output: canvasRef.current,
+ });
+ },
+ clear: () => {
+ instance.clear();
+ },
+ };
+ }, [chainState, height, instance, offscreenCanvas, width]);
+
+ const outerStyle: React.CSSProperties = useMemo(() => {
+ return {
+ pointerEvents: 'none',
+ };
+ }, []);
+
+ const innerStyle: React.CSSProperties = useMemo(() => {
+ return {
+ width: '100%',
+ height: '100%',
+ };
+ }, []);
+
+ return (
+ <AbsoluteFill style={outerStyle}>
+ <canvas
+ ref={canvasRef}
+ width={width}
+ height={height}
+ style={innerStyle}
+ />
+ </AbsoluteFill>
+ );
+};
+
+export const makeHtmlInCanvasPresentation = <
+ TPassedProps extends Record<string, unknown>,
+>(
+ shader: () => HtmlInCanvasShader<TPassedProps>,
+) => {
+ type AugmentedProps = TPassedProps & {_experimentalEffects?: EffectsProp};
+ return (props: AugmentedProps): TransitionPresentation<AugmentedProps> => {
+ return {
+ component: HtmlInCanvasPresentation,
+ props,
+ shader,
+ };
+ };
+};
diff --git a/packages/transitions/src/presentations/zoom-blur.tsx b/packages/transitions/src/presentations/zoom-blur.tsx
index efc1df4b37..d59032b509 100644
--- a/packages/transitions/src/presentations/zoom-blur.tsx
+++ b/packages/transitions/src/presentations/zoom-blur.tsx
@@ -1,107 +1,7 @@
-import {
- useMemo,
- useRef,
- useLayoutEffect,
- useImperativeHandle,
- useState,
-} from 'react';
-import type {RefObject} from 'react';
-import type {EffectsProp} from 'remotion';
-import {
- AbsoluteFill,
- Internals,
- useCurrentFrame,
- useVideoConfig,
-} from 'remotion';
-import type {
- OverlayComponentProps,
- TransitionPresentation,
- TransitionPresentationComponentProps,
-} from '../types';
+import {makeHtmlInCanvasPresentation} from '../html-in-canvas-presentation';
export type ZoomBlurProps = {
rotation?: number;
- _experimentalEffects?: EffectsProp;
-};
-
-export const ZoomBlurPresentation: React.FC<
- TransitionPresentationComponentProps<ZoomBlurProps>
-> = ({
- children,
- onElementImage,
- onUnmount,
- presentationProgress,
- presentationDirection,
-}) => {
- const canvasRef = useRef<HTMLCanvasElement>(null);
- const canvasSubtreeStyle: React.CSSProperties = useMemo(() => {
- return {
- width: '100%',
- height: '100%',
- position: 'absolute',
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- };
- }, []);
-
- const presentationProgressRef = useRef(presentationProgress);
- presentationProgressRef.current = presentationProgress;
-
- useLayoutEffect(() => {
- const canvas = canvasRef.current;
- if (!canvas) {
- return;
- }
-
- canvas.layoutSubtree = true;
-
- const onPaint = () => {
- const firstChild = canvas.firstChild as HTMLElement;
-
- if (!firstChild) {
- return;
- }
-
- const elementImage = canvas.captureElementImage(firstChild);
- onElementImage(elementImage, presentationProgressRef.current);
-
- const context = canvas.getContext('2d');
- if (!context) {
- throw new Error('Failed to get context');
- }
- };
-
- canvas.addEventListener('paint', onPaint);
-
- return () => {
- canvas.removeEventListener('paint', onPaint);
- };
- }, [onElementImage, presentationDirection]);
-
- useLayoutEffect(() => {
- const canvas = canvasRef.current;
- if (!canvas) {
- return;
- }
-
- canvas.requestPaint?.();
- }, [presentationProgress]);
-
- useLayoutEffect(() => {
- return () => {
- onUnmount();
- };
- }, [onUnmount]);
-
- return (
- <AbsoluteFill>
- <canvas ref={canvasRef} style={canvasSubtreeStyle}>
- {children}
- </canvas>
- </AbsoluteFill>
- );
};
export type GLState = {
@@ -116,6 +16,20 @@ export type GLState = {
uMaxAngle: WebGLUniformLocation | null;
};
+export type HtmlInCanvasShader<TPassedProps> = {
+ init: (canvas: OffscreenCanvas) => void;
+ clear: () => void;
+ draw: (params: {
+ prevImage: ElementImage | null;
+ nextImage: ElementImage | null;
+ width: number;
+ height: number;
+ time: number;
+ passedProps: TPassedProps;
+ }) => void;
+ cleanup: () => void;
+};
+
const VERTEX_SHADER = `#version 300 es
in vec2 a_pos;
out vec2 v_uv;
@@ -248,240 +162,160 @@ const createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {
return tex;
};
-export const init = (
- canvas: OffscreenCanvas,
- stateRef: RefObject<GLState | null>,
-) => {
- const gl = canvas.getContext('webgl2', {premultipliedAlpha: true});
- if (!gl) {
- return () => {};
- }
+export const zoomBlurShader = (): HtmlInCanvasShader<ZoomBlurProps> => {
+ let state: GLState | null = null;
- const program = createProgram(gl);
- const prevTex = createTexture(gl);
- const nextTex = createTexture(gl);
-
- const vao = gl.createVertexArray();
- gl.bindVertexArray(vao);
- const buffer = gl.createBuffer();
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
- gl.bufferData(
- gl.ARRAY_BUFFER,
- new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),
- gl.STATIC_DRAW,
- );
- const aPos = gl.getAttribLocation(program, 'a_pos');
- gl.enableVertexAttribArray(aPos);
- gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
-
- stateRef.current = {
- gl,
- program,
- prevTex,
- nextTex,
- uTime: gl.getUniformLocation(program, 'u_time'),
- uPrev: gl.getUniformLocation(program, 'u_prev'),
- uNext: gl.getUniformLocation(program, 'u_next'),
- uAspect: gl.getUniformLocation(program, 'u_aspect'),
- uMaxAngle: gl.getUniformLocation(program, 'u_max_angle'),
+ const init: HtmlInCanvasShader<ZoomBlurProps>['init'] = (canvas) => {
+ const gl = canvas.getContext('webgl2', {premultipliedAlpha: true});
+ if (!gl) {
+ return () => {};
+ }
+
+ const program = createProgram(gl);
+ const prevTex = createTexture(gl);
+ const nextTex = createTexture(gl);
+
+ const vao = gl.createVertexArray();
+ gl.bindVertexArray(vao);
+ const buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),
+ gl.STATIC_DRAW,
+ );
+ const aPos = gl.getAttribLocation(program, 'a_pos');
+ gl.enableVertexAttribArray(aPos);
+ gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
+
+ state = {
+ gl,
+ program,
+ prevTex,
+ nextTex,
+ uTime: gl.getUniformLocation(program, 'u_time'),
+ uPrev: gl.getUniformLocation(program, 'u_prev'),
+ uNext: gl.getUniformLocation(program, 'u_next'),
+ uAspect: gl.getUniformLocation(program, 'u_aspect'),
+ uMaxAngle: gl.getUniformLocation(program, 'u_max_angle'),
+ };
+
+ return () => {};
};
- return () => {
+ const cleanup: HtmlInCanvasShader<ZoomBlurProps>['cleanup'] = () => {
+ if (!state) {
+ throw new Error('Zoom blur state not initialized');
+ }
+
+ const {gl, program, prevTex, nextTex} = state;
gl.deleteProgram(program);
gl.deleteTexture(prevTex);
gl.deleteTexture(nextTex);
- stateRef.current = null;
+ state = null;
};
-};
-export const clear = ({state}: {state: GLState}) => {
- const {gl} = state;
- gl.clearColor(0, 0, 0, 0);
- gl.clear(gl.COLOR_BUFFER_BIT);
-};
-
-export const draw = ({
- prevImage,
- nextImage,
- state,
- width,
- height,
- time,
- rotation,
-}: {
- prevImage: ElementImage | null;
- nextImage: ElementImage | null;
- state: GLState;
- width: number;
- height: number;
- time: number;
- rotation: number;
-}) => {
- const {
- gl,
- program,
- prevTex,
- nextTex,
- uTime,
- uPrev,
- uNext,
- uAspect,
- uMaxAngle,
- } = state;
- if (!prevImage && !nextImage) {
- return;
- }
+ const clear: HtmlInCanvasShader<ZoomBlurProps>['clear'] = () => {
+ if (!state) {
+ throw new Error('Zoom blur state not initialized');
+ }
- if (prevImage && (prevImage.width === 0 || prevImage.height === 0)) {
- return;
- }
+ const {gl} = state;
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ };
- if (nextImage && (nextImage.width === 0 || nextImage.height === 0)) {
- return;
- }
+ const draw: HtmlInCanvasShader<ZoomBlurProps>['draw'] = ({
+ prevImage,
+ nextImage,
+ width,
+ height,
+ time,
+ passedProps,
+ }) => {
+ if (!state) {
+ throw new Error('Zoom blur state not initialized');
+ }
- // When one side is missing, force the mix to fully show the other.
- // At time=0 the shader outputs nextImage (and nextAngle = 0).
- // At time=1 the shader outputs prevImage (and prevAngle = 0).
- const effectiveTime = !prevImage ? 0 : !nextImage ? 1 : time;
-
- gl.viewport(0, 0, width, height);
- gl.clearColor(0, 0, 0, 0);
- gl.clear(gl.COLOR_BUFFER_BIT);
- gl.useProgram(program);
-
- gl.activeTexture(gl.TEXTURE0);
- gl.bindTexture(gl.TEXTURE_2D, prevTex);
- if (prevImage) {
- gl.texElementImage2D(
- gl.TEXTURE_2D,
- 0,
- gl.RGBA,
- gl.RGBA,
- gl.UNSIGNED_BYTE,
- prevImage,
- );
- }
+ const {rotation = Math.PI / 6} = passedProps;
+
+ const {
+ gl,
+ program,
+ prevTex,
+ nextTex,
+ uTime,
+ uPrev,
+ uNext,
+ uAspect,
+ uMaxAngle,
+ } = state;
+
+ if (!prevImage && !nextImage) {
+ return;
+ }
- gl.uniform1i(uPrev, 0);
-
- gl.activeTexture(gl.TEXTURE1);
- gl.bindTexture(gl.TEXTURE_2D, nextTex);
- if (nextImage) {
- gl.texElementImage2D(
- gl.TEXTURE_2D,
- 0,
- gl.RGBA,
- gl.RGBA,
- gl.UNSIGNED_BYTE,
- nextImage,
- );
- }
+ if (prevImage && (prevImage.width === 0 || prevImage.height === 0)) {
+ return;
+ }
- gl.uniform1i(uNext, 1);
+ if (nextImage && (nextImage.width === 0 || nextImage.height === 0)) {
+ return;
+ }
- gl.uniform1f(uTime, effectiveTime);
- gl.uniform1f(uAspect, width / height);
- gl.uniform1f(uMaxAngle, rotation);
+ // When one side is missing, force the mix to fully show the other.
+ // At time=0 the shader outputs nextImage (and nextAngle = 0).
+ // At time=1 the shader outputs prevImage (and prevAngle = 0).
+ const effectiveTime = !prevImage ? 0 : !nextImage ? 1 : time;
+
+ gl.viewport(0, 0, width, height);
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.useProgram(program);
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, prevTex);
+ if (prevImage) {
+ gl.texElementImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ gl.RGBA,
+ gl.RGBA,
+ gl.UNSIGNED_BYTE,
+ prevImage,
+ );
+ }
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
-};
+ gl.uniform1i(uPrev, 0);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, nextTex);
+ if (nextImage) {
+ gl.texElementImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ gl.RGBA,
+ gl.RGBA,
+ gl.UNSIGNED_BYTE,
+ nextImage,
+ );
+ }
-export const ShaderOverlay: React.FC<OverlayComponentProps<ZoomBlurProps>> = ({
- refToMethods,
- passedProps: {rotation = Math.PI / 6, _experimentalEffects = []},
-}) => {
- const {width, height} = useVideoConfig();
- const [offscreenCanvas] = useState(() => new OffscreenCanvas(width, height));
- const canvasRef = useRef<HTMLCanvasElement>(null);
- const stateRef = useRef<GLState | null>(null);
- const frame = useCurrentFrame();
- const frameRef = useRef(frame);
- frameRef.current = frame;
-
- useLayoutEffect(() => {
- const cleanup = init(offscreenCanvas, stateRef);
-
- return () => {
- cleanup();
- };
- }, [offscreenCanvas]);
-
- const chainState = Internals.useEffectChainState();
-
- useImperativeHandle(refToMethods, () => {
- return {
- draw: (
- prevImage: ElementImage | null,
- nextImage: ElementImage | null,
- progress: number,
- ) => {
- if (!canvasRef.current || !stateRef.current) {
- return;
- }
-
- draw({
- prevImage,
- nextImage,
- state: stateRef.current,
- width,
- height,
- time: progress,
- rotation,
- });
- offscreenCanvas.width = width;
- offscreenCanvas.height = height;
- Internals.runEffectChain({
- state: chainState.get(width, height)!,
- source: offscreenCanvas,
- effects: _experimentalEffects,
- frame: frameRef.current,
- width,
- height,
- output: canvasRef.current,
- });
- },
- clear: () => {
- if (!stateRef.current) {
- return;
- }
-
- clear({state: stateRef.current});
- },
- };
- });
+ gl.uniform1i(uNext, 1);
- const outerStyle: React.CSSProperties = useMemo(() => {
- return {
- pointerEvents: 'none',
- };
- }, []);
+ gl.uniform1f(uTime, effectiveTime);
+ gl.uniform1f(uAspect, width / height);
+ gl.uniform1f(uMaxAngle, rotation);
- const innerStyle: React.CSSProperties = useMemo(() => {
- return {
- width: '100%',
- height: '100%',
- };
- }, []);
-
- return (
- <AbsoluteFill style={outerStyle}>
- <canvas
- ref={canvasRef}
- width={width}
- height={height}
- style={innerStyle}
- />
- </AbsoluteFill>
- );
-};
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+ };
-export const zoomBlur = (
- props: ZoomBlurProps,
-): TransitionPresentation<ZoomBlurProps> => {
return {
- component: ZoomBlurPresentation,
- props: props ?? {},
- overlay: ShaderOverlay,
+ init,
+ clear,
+ draw,
+ cleanup,
};
};
+
+export const zoomBlur = makeHtmlInCanvasPresentation(zoomBlurShader);
diff --git a/packages/transitions/src/types.ts b/packages/transitions/src/types.ts
index 8dc8771782..a145e6ed28 100644
--- a/packages/transitions/src/types.ts
+++ b/packages/transitions/src/types.ts
@@ -1,5 +1,7 @@
import type {ComponentType} from 'react';
import type React from 'react';
+import type {EffectsProp} from 'remotion';
+import type {HtmlInCanvasShader} from './presentations/zoom-blur';
export type PresentationDirection = 'entering' | 'exiting';
@@ -26,18 +28,16 @@ export type OverlayMethods = {
clear: () => void;
};
-export type MandatoryOverlayProps = {
+export type MandatoryOverlayComponentProps<
+ PresentationProps extends Record<string, unknown>,
+> = {
readonly refToMethods: React.RefObject<OverlayMethods | null>;
+ readonly passedProps: PresentationProps & {
+ _experimentalEffects?: EffectsProp;
+ };
+ readonly shader: () => HtmlInCanvasShader<PresentationProps>;
};
-export type OverlayComponentProps<
- PresentationProps extends Record<string, unknown>,
-> = Pick<
- TransitionPresentationComponentProps<PresentationProps>,
- 'presentationProgress' | 'passedProps'
-> &
- MandatoryOverlayProps;
-
export type TransitionPresentation<
PresentationProps extends Record<string, unknown>,
> = {
@@ -45,7 +45,7 @@ export type TransitionPresentation<
TransitionPresentationComponentProps<PresentationProps>
>;
props: PresentationProps;
- overlay?: LooseComponentType<OverlayComponentProps<PresentationProps>>;
+ shader?: () => HtmlInCanvasShader<PresentationProps>;
};
export type TransitionPresentationComponentProps<