Skip to content

🎥 Make videos programmatically with React

Deprecate Sequence outlineRef and remove userland overrides

JonnyBurger2c1b9c0fc252
diff --git a/packages/brand/src/3DContext/Div3D.tsx b/packages/brand/src/3DContext/Div3D.tsx
index 8f3410f211..6f2e457ea5 100644
--- a/packages/brand/src/3DContext/Div3D.tsx
+++ b/packages/brand/src/3DContext/Div3D.tsx
@@ -133,17 +133,6 @@ const extrudeDivSchema = {
...Interactive.borderRadiusSchema,
} as const satisfies InteractivitySchema;
-const setRef = <ElementType,>(
- ref: React.ForwardedRef<ElementType>,
- value: ElementType | null,
-) => {
- if (typeof ref === 'function') {
- ref(value);
- } else if (ref) {
- ref.current = value;
- }
-};
-
const numberWithUnitPattern =
/^([+-]?(?:\d+\.?\d*|\.\d+))(px|%|deg|rad|turn|grad)$/i;
const numberPattern = /^[+-]?(?:\d+\.?\d*|\.\d+)$/;
@@ -469,17 +458,6 @@ const ExtrudeDivInner = React.forwardRef<
return transformPoint({matrix: localTransform, point: parentCenterPoint});
}, [localTransform, parentCenterPoint]);
const frontFace = isBacksideVisible(combinedTransform);
- const outlineRef = React.useRef<HTMLDivElement | null>(null);
- const callbackRef = React.useCallback(
- (element: HTMLDivElement | null) => {
- if (depth === 0) {
- outlineRef.current = element;
- }
-
- setRef(ref, element);
- },
- [depth, ref],
- );
return (
<Sequence
@@ -493,7 +471,6 @@ const ExtrudeDivInner = React.forwardRef<
showInTimeline={showInTimeline ?? true}
controls={controls ?? undefined}
_remotionInternalDocumentationLink="https://www.remotion.dev/docs/studio/make-component-interactive"
- outlineRef={outlineRef}
>
<TransformContext.Provider value={combinedTransform}>
<CenterPointContext.Provider value={combinedCenterPoint}>
@@ -503,7 +480,7 @@ const ExtrudeDivInner = React.forwardRef<
cornerRadius={cornerRadius}
>
<div
- ref={callbackRef}
+ ref={ref}
style={{
...style,
width,
@@ -521,11 +498,11 @@ const ExtrudeDivInner = React.forwardRef<
>
{depth > 0 ? <DivExtrusion depth={depth} /> : children}
{depth === 0 ? null : !frontFace ? (
- <Face type="front" depth={depth} outlineRef={outlineRef}>
+ <Face type="front" depth={depth}>
{children}
</Face>
) : (
- <Face type="back" depth={depth} outlineRef={outlineRef}>
+ <Face type="back" depth={depth}>
{backFace}
</Face>
)}
diff --git a/packages/brand/src/3DContext/FrontFace.tsx b/packages/brand/src/3DContext/FrontFace.tsx
index 913eaed262..4f165650c0 100644
--- a/packages/brand/src/3DContext/FrontFace.tsx
+++ b/packages/brand/src/3DContext/FrontFace.tsx
@@ -10,9 +10,8 @@ import {useTransformations} from './transformation-context';
export const Face: React.FC<{
children: React.ReactNode;
depth: number;
- outlineRef?: React.RefObject<HTMLDivElement | null>;
type: 'front' | 'back';
-}> = ({children, depth, outlineRef, type}) => {
+}> = ({children, depth, type}) => {
const {width, height} = useRect();
const frontFace = reduceMatrices([
@@ -23,7 +22,6 @@ export const Face: React.FC<{
return (
<div
- ref={outlineRef}
style={{
transform: makeMatrix3dTransform(frontFace),
display: 'flex',
diff --git a/packages/brand/src/video-elements/Studio.tsx b/packages/brand/src/video-elements/Studio.tsx
index a044450f5c..678ed85e9a 100644
--- a/packages/brand/src/video-elements/Studio.tsx
+++ b/packages/brand/src/video-elements/Studio.tsx
@@ -1662,10 +1662,10 @@ const StudioInner = React.forwardRef<
},
ref,
) => {
- const outlineRef = React.useRef<HTMLDivElement>(null);
+ const elementRef = React.useRef<HTMLDivElement>(null);
React.useImperativeHandle(
ref,
- () => outlineRef.current as HTMLDivElement,
+ () => elementRef.current as HTMLDivElement,
[],
);
const {height: videoHeight, fps} = useVideoConfig();
@@ -1716,7 +1716,7 @@ const StudioInner = React.forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
backgroundColor: BACKGROUND,
color: WHITE,
diff --git a/packages/codemods/src/basic-captions-element-source.ts b/packages/codemods/src/basic-captions-element-source.ts
index 135d2c4a61..5112446412 100644
--- a/packages/codemods/src/basic-captions-element-source.ts
+++ b/packages/codemods/src/basic-captions-element-source.ts
@@ -127,8 +127,8 @@ const BasicCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ const elementRef = useRef<HTMLDivElement>(null);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -141,7 +141,7 @@ const BasicCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
alignItems: 'center',
display: 'flex',
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index a57e18ba96..bed0fc4154 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -130,8 +130,8 @@ export type SequencePropsWithoutDuration = {
src: string;
};
/**
- * A React ref pointing to the element that Remotion Studio should use for
- * drawing the selection outline in the preview.
+ * @deprecated Remotion Studio discovers rendered elements automatically.
+ * Remove this prop.
*/
readonly outlineRef?: React.RefObject<Element | null> | null;
} & LayoutAndStyle;
diff --git a/packages/docs/docs/interactive-with-schema.mdx b/packages/docs/docs/interactive-with-schema.mdx
index f52a5def74..03b52ca1a0 100644
--- a/packages/docs/docs/interactive-with-schema.mdx
+++ b/packages/docs/docs/interactive-with-schema.mdx
@@ -65,9 +65,9 @@ const CircleInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -77,7 +77,7 @@ const CircleInner = forwardRef<
controls={controls}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
...style,
width: radius * 2,
@@ -101,7 +101,7 @@ export const Circle = Interactive.withSchema({
The exported `Circle` component only accepts `CircleProps`. The `controls` prop is passed by `Interactive.withSchema()` to the inner component and should be forwarded unchanged to the [`<Sequence>`](/docs/sequence) that represents the component in the timeline. It also preserves the outer component's source location for Studio edits.
-With `<Sequence layout="none">`, the Studio discovers the rendered element automatically. Pass [`outlineRef`](/docs/sequence#outlineref) when you need to select a specific element.
+With `<Sequence layout="none">`, the Studio discovers the rendered element automatically.
## API
diff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdx
index 502f161b1c..287ce7ec67 100644
--- a/packages/docs/docs/sequence.mdx
+++ b/packages/docs/docs/sequence.mdx
@@ -334,27 +334,13 @@ export const MyVideo = () => {
};
```
-### `outlineRef?`<AvailableFrom v="4.0.479" />
+### ~~`outlineRef?`~~<AvailableFrom v="4.0.479" />
-A React ref pointing to the element that Remotion Studio should use for drawing the selection outline in the preview.
-
-By default, the Studio outlines the wrapper created by `<Sequence>`. With `layout="none"`, it outlines the rendered element or the bounds of multiple rendered roots. Pass `outlineRef` when you want to outline one specific element instead.
-
-```tsx twoslash title="MyVideo.tsx"
-import {useRef} from 'react';
-import {Sequence} from 'remotion';
-
-export const MyVideo = () => {
- const outlineRef = useRef<HTMLDivElement>(null);
+:::info Deprecated
+Remotion Studio discovers selection outlines automatically. Remove this prop.
+:::
- return (
- <Sequence layout="none" outlineRef={outlineRef}>
- <div ref={outlineRef}>Included in the outline</div>
- <div>Excluded from the outline</div>
- </Sequence>
- );
-};
-```
+By default, the Studio outlines the wrapper created by `<Sequence>`. With `layout="none"`, it outlines the rendered element or the bounds of multiple rendered roots.
### `style?`<AvailableFrom v="3.0.27"/>
diff --git a/packages/docs/docs/studio/make-component-interactive.mdx b/packages/docs/docs/studio/make-component-interactive.mdx
index 1f3b8afcf1..50d44d2b11 100644
--- a/packages/docs/docs/studio/make-component-interactive.mdx
+++ b/packages/docs/docs/studio/make-component-interactive.mdx
@@ -133,9 +133,9 @@ const BadgeInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -145,7 +145,7 @@ const BadgeInner = forwardRef<
controls={controls}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
...style,
display: 'inline-flex',
@@ -166,7 +166,7 @@ const BadgeInner = forwardRef<
The exported component should not expose `controls` as a public prop.
-With `<Sequence layout="none">`, the Studio discovers the rendered element automatically. Pass [`outlineRef`](/docs/sequence#outlineref) when you need to select a specific element.
+With `<Sequence layout="none">`, the Studio discovers the rendered element automatically.
## Wrap the component
@@ -224,9 +224,9 @@ const BadgeInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -236,7 +236,7 @@ const BadgeInner = forwardRef<
controls={controls}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
...style,
display: 'inline-flex',
diff --git a/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx b/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx
index 27ead864a0..c1ae2a7e8a 100644
--- a/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx
+++ b/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx
@@ -60,10 +60,10 @@ const MirroredAudioSpectrumContent: React.FC<{
readonly audioSrc: string;
readonly barColor: string;
readonly numberOfBars: number;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly sensitivity: number;
readonly style: MirroredAudioSpectrumProps['style'];
-}> = ({audioSrc, barColor, numberOfBars, outlineRef, sensitivity, style}) => {
+}> = ({audioSrc, barColor, numberOfBars, elementRef, sensitivity, style}) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const {audioData, dataOffsetInSeconds} = useWindowedAudioData({
@@ -95,7 +95,7 @@ const MirroredAudioSpectrumContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
alignItems: 'center',
boxSizing: 'border-box',
@@ -144,8 +144,8 @@ const MirroredAudioSpectrumInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ const elementRef = useRef<HTMLDivElement>(null);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -158,7 +158,7 @@ const MirroredAudioSpectrumInner = forwardRef<
audioSrc={audioSrc}
barColor={barColor}
numberOfBars={numberOfBars}
- outlineRef={outlineRef}
+ elementRef={elementRef}
sensitivity={sensitivity}
style={style}
/>
diff --git a/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx b/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx
index ecedd74b51..ec15eee4e3 100644
--- a/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx
+++ b/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx
@@ -74,7 +74,7 @@ const AudioOscilloscopeContent: React.FC<{
readonly audioSrc: string;
readonly lineColor: string;
readonly lineWidth: number;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly style: AudioOscilloscopeProps['style'];
readonly windowInSeconds: number;
}> = ({
@@ -82,7 +82,7 @@ const AudioOscilloscopeContent: React.FC<{
audioSrc,
lineColor,
lineWidth,
- outlineRef,
+ elementRef,
style,
windowInSeconds,
}) => {
@@ -116,7 +116,7 @@ const AudioOscilloscopeContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
boxSizing: 'border-box',
height: 300,
@@ -169,9 +169,9 @@ const AudioOscilloscopeInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -185,7 +185,7 @@ const AudioOscilloscopeInner = forwardRef<
audioSrc={audioSrc}
lineColor={lineColor}
lineWidth={lineWidth}
- outlineRef={outlineRef}
+ elementRef={elementRef}
style={style}
windowInSeconds={windowInSeconds}
/>
diff --git a/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx b/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx
index 848dc19517..0f0e5c1a60 100644
--- a/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx
+++ b/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx
@@ -195,9 +195,9 @@ const AudioWaveformProgressInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -208,7 +208,7 @@ const AudioWaveformProgressInner = forwardRef<
name={name ?? 'Audio waveform progress'}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
boxSizing: 'border-box',
height: 300,
diff --git a/packages/docs/elements/captions/basic-captions/basic-captions.tsx b/packages/docs/elements/captions/basic-captions/basic-captions.tsx
index 02209f2acd..101309bc07 100644
--- a/packages/docs/elements/captions/basic-captions/basic-captions.tsx
+++ b/packages/docs/elements/captions/basic-captions/basic-captions.tsx
@@ -134,9 +134,9 @@ const BasicCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -147,7 +147,7 @@ const BasicCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
alignItems: 'center',
display: 'flex',
diff --git a/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx b/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx
index 412d0c5103..78239f9ffc 100644
--- a/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx
+++ b/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx
@@ -394,10 +394,10 @@ const MovingPillCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const [fontLoaded, setFontLoaded] = useState(false);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
useEffect(() => {
waitUntilDone()
@@ -420,7 +420,7 @@ const MovingPillCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
height,
marginInline: 'auto',
diff --git a/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx b/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx
index cd3d430c46..366a2ff954 100644
--- a/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx
+++ b/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx
@@ -305,10 +305,10 @@ const PoppingWordCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const [fontLoaded, setFontLoaded] = useState(false);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
useEffect(() => {
waitUntilDone()
@@ -331,7 +331,7 @@ const PoppingWordCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
height,
marginInline: 'auto',
diff --git a/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx b/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx
index f1bfb34b13..937d7a6343 100644
--- a/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx
+++ b/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx
@@ -233,10 +233,10 @@ const RoundedCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const [fontLoaded, setFontLoaded] = useState(false);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
useEffect(() => {
waitUntilDone()
@@ -253,7 +253,7 @@ const RoundedCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
alignItems: 'center',
display: 'flex',
diff --git a/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx b/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx
index 28a35d691e..880f2512da 100644
--- a/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx
+++ b/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx
@@ -263,10 +263,10 @@ const WordHighlightCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const [fontLoaded, setFontLoaded] = useState(false);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
useEffect(() => {
waitUntilDone()
@@ -289,7 +289,7 @@ const WordHighlightCaptionsInner = forwardRef<
trimBefore={trimBefore}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
height,
marginInline: 'auto',
diff --git a/packages/docs/elements/commerce/product-collection/product-collection.tsx b/packages/docs/elements/commerce/product-collection/product-collection.tsx
index 8019234995..f9e9c2e316 100644
--- a/packages/docs/elements/commerce/product-collection/product-collection.tsx
+++ b/packages/docs/elements/commerce/product-collection/product-collection.tsx
@@ -44,7 +44,7 @@ const ProductCardInner = forwardRef<
HTMLDivElement,
ProductCardProps & {readonly controls: SequenceControls | undefined}
>(({controls, count, index, label, name, style, ...sequenceProps}, ref) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const frame = useCurrentFrame();
const lastProductIndex = Math.max(0, count - 1);
const rawScrollPosition = interpolate(
@@ -101,7 +101,7 @@ const ProductCardInner = forwardRef<
extrapolateRight: 'clamp',
});
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -109,7 +109,6 @@ const ProductCardInner = forwardRef<
{...sequenceProps}
controls={controls}
name={name ?? '<ProductCard>'}
- outlineRef={outlineRef}
>
<div
style={{
@@ -128,7 +127,7 @@ const ProductCardInner = forwardRef<
}}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
...style,
backgroundColor: '#ffffff',
diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdx
index 6610eba2e7..687c64aeaa 100644
--- a/packages/docs/elements/guidelines.mdx
+++ b/packages/docs/elements/guidelines.mdx
@@ -54,7 +54,7 @@ Export the schema-enabled component directly and wire up the common props:
- Add [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) to every `Interactive.withSchema()` schema and pass `controls` unchanged to the component's `<Sequence>`.
- Pass `from`, `durationInFrames`, `trimBefore`, `playbackRate`, `freeze`, `hidden`, `name`, and `showInTimeline` to that Sequence.
-- Pass `style` and the ref to the rendered element. With `layout="none"`, the Studio discovers the outline automatically; use [`outlineRef`](/docs/sequence#outlineref) to select a specific element. Set the dimensions in the component because Element metadata does not pass them as props.
+- Pass `style` and the ref to the rendered element. With `layout="none"`, the Studio discovers the outline automatically. Set the dimensions in the component because Element metadata does not pass them as props.
- Render frame-dependent animation in a child below the Sequence. This makes [`useCurrentFrame()`](/docs/use-current-frame) respect `from`, `trimBefore`, `playbackRate`, and `freeze`. If the component that returns the Sequence calls it, it reads the parent clock.
Export the schema-enabled component directly, without a forwarding wrapper. See the [oscilloscope](/elements/audio/oscilloscope), [waveform progress](/elements/audio/waveform-progress), and [mirrored spectrum](/elements/audio/mirrored-spectrum) Elements.
diff --git a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
index 6a272d4eb3..bb39c7e9f4 100644
--- a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
+++ b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
@@ -284,7 +284,7 @@ const MapFlyoverContent: React.FC<{
readonly lineWidth: number;
readonly origin: readonly [number, number];
readonly originLabel: string;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly routeColor: string;
readonly style: React.CSSProperties | null;
}> = ({
@@ -293,7 +293,7 @@ const MapFlyoverContent: React.FC<{
lineWidth,
origin,
originLabel,
- outlineRef,
+ elementRef,
routeColor,
style,
}) => {
@@ -481,7 +481,7 @@ const MapFlyoverContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
backgroundColor: '#dbe4e8',
height,
@@ -627,8 +627,8 @@ const MapFlyoverLayerInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ const elementRef = useRef<HTMLDivElement>(null);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -643,7 +643,7 @@ const MapFlyoverLayerInner = forwardRef<
lineWidth={lineWidth}
origin={origin}
originLabel={originLabel}
- outlineRef={outlineRef}
+ elementRef={elementRef}
routeColor={routeColor}
style={style ?? null}
/>
diff --git a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
index d731d31e92..9d25361c5e 100644
--- a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
+++ b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
@@ -168,7 +168,7 @@ const WatercolorMapContent: React.FC<{
readonly destinationLabel: string;
readonly origin: Coordinates;
readonly originLabel: string;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly routeColor: string;
readonly routeWidth: number;
readonly style: React.CSSProperties | undefined;
@@ -177,7 +177,7 @@ const WatercolorMapContent: React.FC<{
destinationLabel,
origin,
originLabel,
- outlineRef,
+ elementRef,
routeColor,
routeWidth,
style,
@@ -256,7 +256,7 @@ const WatercolorMapContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
backgroundColor: '#e6ec88',
height,
@@ -424,8 +424,8 @@ const WatercolorMapInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ const elementRef = useRef<HTMLDivElement>(null);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -439,7 +439,7 @@ const WatercolorMapInner = forwardRef<
destinationLabel={destinationLabel}
origin={origin}
originLabel={originLabel}
- outlineRef={outlineRef}
+ elementRef={elementRef}
routeColor={routeColor}
routeWidth={routeWidth}
style={style}
diff --git a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx
index 64ebc42e23..8b78a245c3 100644
--- a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx
+++ b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx
@@ -35,9 +35,9 @@ const SocialSafeZonesInner = forwardRef<
readonly controls: SequenceControls | undefined;
}
>(({controls, name, platform = 'instagram', style, ...sequenceProps}, ref) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -47,7 +47,7 @@ const SocialSafeZonesInner = forwardRef<
name={name ?? 'Social Safe Zones'}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
...style,
height: 1920,
diff --git a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
index 68449fee3b..42ac02793f 100644
--- a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
+++ b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
@@ -58,7 +58,7 @@ const SpinningTextWheelInner = forwardRef<
) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const values = items
.split('\n')
.map((item) => item.trim())
@@ -86,7 +86,7 @@ const SpinningTextWheelInner = forwardRef<
...callerContentStyle
} = callerStyle ?? {};
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -94,7 +94,6 @@ const SpinningTextWheelInner = forwardRef<
{...sequenceProps}
controls={controls}
name={name ?? '<SpinningTextWheel>'}
- outlineRef={outlineRef}
>
<div
style={{
@@ -108,7 +107,7 @@ const SpinningTextWheelInner = forwardRef<
}}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
height: 200,
maskImage:
diff --git a/packages/example/src/CaptionsTester/AnimatedCaptions.tsx b/packages/example/src/CaptionsTester/AnimatedCaptions.tsx
index 366f96f75f..3460dd1506 100644
--- a/packages/example/src/CaptionsTester/AnimatedCaptions.tsx
+++ b/packages/example/src/CaptionsTester/AnimatedCaptions.tsx
@@ -123,7 +123,7 @@ const AnimatedCaptionsInner = forwardRef<
HTMLDivElement,
AnimatedCaptionsProps & {readonly controls: SequenceControls | undefined}
>(({captions, controls, name, style, ...sequenceProps}, ref) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const {fps} = useVideoConfig();
const pages = useMemo(() => {
return createTikTokStyleCaptions({
@@ -132,11 +132,11 @@ const AnimatedCaptionsInner = forwardRef<
}).pages;
}, [captions]);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
- ref={outlineRef}
+ ref={elementRef}
{...sequenceProps}
name={name ?? '<AnimatedCaptions>'}
style={style}
diff --git a/packages/example/src/LayoutNoneOutlines.tsx b/packages/example/src/LayoutNoneOutlines.tsx
index 9fba0effd2..a8f2bf68ea 100644
--- a/packages/example/src/LayoutNoneOutlines.tsx
+++ b/packages/example/src/LayoutNoneOutlines.tsx
@@ -1,4 +1,4 @@
-import React, {useRef} from 'react';
+import React from 'react';
import {AbsoluteFill, Sequence, useCurrentFrame} from 'remotion';
const card: React.CSSProperties = {
@@ -43,7 +43,6 @@ const Siblings: React.FC = () => {
};
export const LayoutNoneOutlines: React.FC = () => {
- const outlineRef = useRef<HTMLDivElement | null>(null);
return (
<AbsoluteFill
style={{background: '#0f172a', color: 'white', fontFamily: 'sans-serif'}}
@@ -79,23 +78,6 @@ export const LayoutNoneOutlines: React.FC = () => {
</span>
</Sequence>
</div>
- <Sequence
- layout="none"
- name="Explicit outlineRef wins"
- outlineRef={outlineRef}
- >
- <div
- ref={outlineRef}
- style={{...card, left: 720, top: 500, background: '#be185d'}}
- >
- Explicit target
- </div>
- <div
- style={{...card, left: 960, top: 500, border: '2px dashed #64748b'}}
- >
- Outside outline
- </div>
- </Sequence>
</AbsoluteFill>
);
};
diff --git a/packages/example/src/mirrored-spectrum.element.tsx b/packages/example/src/mirrored-spectrum.element.tsx
index 3381607976..c1cd855e5d 100644
--- a/packages/example/src/mirrored-spectrum.element.tsx
+++ b/packages/example/src/mirrored-spectrum.element.tsx
@@ -60,10 +60,10 @@ const MirroredAudioSpectrumContent: React.FC<{
readonly audioSrc: string;
readonly barColor: string;
readonly numberOfBars: number;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly sensitivity: number;
readonly style: MirroredAudioSpectrumProps['style'];
-}> = ({audioSrc, barColor, numberOfBars, outlineRef, sensitivity, style}) => {
+}> = ({audioSrc, barColor, numberOfBars, elementRef, sensitivity, style}) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const {audioData, dataOffsetInSeconds} = useWindowedAudioData({
@@ -95,7 +95,7 @@ const MirroredAudioSpectrumContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
alignItems: 'center',
boxSizing: 'border-box',
@@ -144,8 +144,8 @@ const MirroredAudioSpectrumInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ const elementRef = useRef<HTMLDivElement>(null);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -158,7 +158,7 @@ const MirroredAudioSpectrumInner = forwardRef<
audioSrc={audioSrc}
barColor={barColor}
numberOfBars={numberOfBars}
- outlineRef={outlineRef}
+ elementRef={elementRef}
sensitivity={sensitivity}
style={style}
/>
diff --git a/packages/example/src/moving-pill-captions.element.tsx b/packages/example/src/moving-pill-captions.element.tsx
index 6710071668..3b67aed574 100644
--- a/packages/example/src/moving-pill-captions.element.tsx
+++ b/packages/example/src/moving-pill-captions.element.tsx
@@ -398,10 +398,10 @@ const MovingPillCaptionsInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
const [fontLoaded, setFontLoaded] = useState(false);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
useEffect(() => {
waitUntilDone()
@@ -423,7 +423,7 @@ const MovingPillCaptionsInner = forwardRef<
name={name ?? '<MovingPillCaptions>'}
>
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
height,
marginInline: 'auto',
diff --git a/packages/example/src/oscilloscope.element.tsx b/packages/example/src/oscilloscope.element.tsx
index 3d90c5186c..276e3af546 100644
--- a/packages/example/src/oscilloscope.element.tsx
+++ b/packages/example/src/oscilloscope.element.tsx
@@ -74,7 +74,7 @@ const AudioOscilloscopeContent: React.FC<{
readonly audioSrc: string;
readonly lineColor: string;
readonly lineWidth: number;
- readonly outlineRef: React.RefObject<HTMLDivElement | null>;
+ readonly elementRef: React.RefObject<HTMLDivElement | null>;
readonly style: AudioOscilloscopeProps['style'];
readonly windowInSeconds: number;
}> = ({
@@ -82,7 +82,7 @@ const AudioOscilloscopeContent: React.FC<{
audioSrc,
lineColor,
lineWidth,
- outlineRef,
+ elementRef,
style,
windowInSeconds,
}) => {
@@ -116,7 +116,7 @@ const AudioOscilloscopeContent: React.FC<{
return (
<div
- ref={outlineRef}
+ ref={elementRef}
style={{
boxSizing: 'border-box',
height: 300,
@@ -169,9 +169,9 @@ const AudioOscilloscopeInner = forwardRef<
},
ref,
) => {
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -185,7 +185,7 @@ const AudioOscilloscopeInner = forwardRef<
audioSrc={audioSrc}
lineColor={lineColor}
lineWidth={lineWidth}
- outlineRef={outlineRef}
+ elementRef={elementRef}
style={style}
windowInSeconds={windowInSeconds}
/>
diff --git a/packages/jonnys-videos/src/components/AnimatedCaptions.tsx b/packages/jonnys-videos/src/components/AnimatedCaptions.tsx
index a1bd9fc1ab..a39ed83b02 100644
--- a/packages/jonnys-videos/src/components/AnimatedCaptions.tsx
+++ b/packages/jonnys-videos/src/components/AnimatedCaptions.tsx
@@ -450,9 +450,9 @@ const AnimatedCaptionsInner = forwardRef<
voiceoverSrc,
...interactiveProps
} = props;
- const outlineRef = useRef<HTMLDivElement>(null);
+ const elementRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
+ useImperativeHandle(ref, () => elementRef.current as HTMLDivElement, []);
return (
<Sequence
@@ -461,7 +461,7 @@ const AnimatedCaptionsInner = forwardRef<
controls={controls}
name={name ?? '<AnimatedCaptions>'}
>
- <AbsoluteFill ref={outlineRef}>
+ <AbsoluteFill ref={elementRef}>
{captions ? (
<AnimatedCaptionsContent
captions={captions}