Skip to content

Commit 0ca3851

Browse files
committed
tweak React example
1 parent e2ce676 commit 0ca3851

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

docs/getting-started.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ The first is to server-side render (SSR) plots. This minimizes distracting reflo
137137
import * as Plot from "@observablehq/plot";
138138
import {createElement as h} from "react";
139139

140-
const PlotFigure = ({ options: { document = new Document(), ...options } }) => {
141-
return Plot.plot({ document, ...options }).toHyperScript();
142-
};
143-
144-
export default PlotFigure;
140+
export default function PlotFigure({options}) {
141+
return Plot.plot({...options, document: new Document()}).toHyperScript();
142+
}
145143
```
146144
:::
147145

0 commit comments

Comments
 (0)