Skip to content

🎥 Make videos programmatically with React

reload if props change

Jonny Burgerd24fa4dc26be
diff --git a/packages/cli/src/event-source.ts b/packages/cli/src/event-source.ts
index 91fd3f59e2..05656b6560 100644
--- a/packages/cli/src/event-source.ts
+++ b/packages/cli/src/event-source.ts
@@ -8,7 +8,7 @@ export const openEventSource = () => {
source.addEventListener('message', (event) => {
const newEvent = JSON.parse(event.data) as EventSourceEvent;
if (newEvent.type === 'new-input-props') {
- window.remotion_inputProps = JSON.stringify(newEvent.newProps);
+ window.location.reload();
}
});
};
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index f88b754ca9..54e4bedcb9 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -36,7 +36,6 @@ if (alias !== 'alias') {
export const Index: React.FC = () => {
const inputProps = getInputProps();
- console.log(JSON.stringify({inputProps}));
return (
<>
<Folder name="components">
diff --git a/packages/example/src/my-props.json b/packages/example/src/my-props.json
index bbf2754e05..df68a9c2e9 100644
--- a/packages/example/src/my-props.json
+++ b/packages/example/src/my-props.json
@@ -1,3 +1,3 @@
{
- "hi": "theree\"'''e'ee"
+ "hello": "world"
}