Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: Fix twoslash error in sample-rate.mdx

Jonny Burgerb1ad78b759f3
diff --git a/packages/docs/docs/sample-rate.mdx b/packages/docs/docs/sample-rate.mdx
index 139c6f15a7..ed24a53396 100644
--- a/packages/docs/docs/sample-rate.mdx
+++ b/packages/docs/docs/sample-rate.mdx
@@ -45,21 +45,22 @@ await renderMedia({
### Via `renderMediaOnWeb()`
-```ts twoslash title="web-render.ts"
+```tsx twoslash title="web-render.ts"
// @module: es2022
// @target: es2017
import {renderMediaOnWeb} from '@remotion/web-renderer';
-const composition = {
- id: 'MyComp',
- durationInFrames: 100,
- fps: 30,
- width: 1920,
- height: 1080,
- defaultProps: {},
-};
-// ---cut---
-await renderMediaOnWeb({
- composition,
+
+const MyComp: React.FC = () => null;
+
+const {getBlob} = await renderMediaOnWeb({
+ composition: {
+ component: MyComp,
+ durationInFrames: 100,
+ fps: 30,
+ width: 1920,
+ height: 1080,
+ id: 'MyComp',
+ },
sampleRate: 44100,
});
```