Skip to content

🎥 Make videos programmatically with React

fix timeline clip name of a default export

Jonny Burger675d1fc734c1
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index 3d5acb7ece..bd7b9dd801 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -51,7 +51,7 @@ export const Sequence: React.FC<SequenceProps> = ({
...other
}) => {
const {layout = 'absolute-fill'} = other;
- const [id] = useState(() => String(Math.random()));
+ const [id] = useState(() => String(() => Math.random()));
const parentSequence = useContext(SequenceContext);
const {rootId} = useContext(TimelineContext);
const cumulatedFrom = parentSequence
diff --git a/packages/core/src/get-timeline-clip-name.ts b/packages/core/src/get-timeline-clip-name.ts
index 772b24fcc6..72109d1b99 100644
--- a/packages/core/src/get-timeline-clip-name.ts
+++ b/packages/core/src/get-timeline-clip-name.ts
@@ -1,5 +1,7 @@
import {Children, isValidElement} from 'react';
+const HIDDEN_NAMES = ['__WEBPACK_DEFAULT_EXPORT__'];
+
export const getTimelineClipName = (children: React.ReactNode): string => {
const tree = Children.map(children, (ch) => {
if (!isValidElement(ch)) {
@@ -8,7 +10,7 @@ export const getTimelineClipName = (children: React.ReactNode): string => {
// Must be name, not ID
const name = typeof ch.type !== 'string' && ch.type.name;
- if (name) {
+ if (name && !HIDDEN_NAMES.includes(name)) {
return name;
}