Skip to content

Commit

Permalink
fix(demo): use named default components for next.js fast refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
hshoff committed Oct 23, 2020
1 parent 434710f commit ffd7bf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/visx-demo/src/sandboxes/visx-heatmap/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type HeatmapProps = {

const defaultMargin = { top: 10, left: 20, right: 20, bottom: 110 };

export default ({
const Example = ({
width,
height,
events = false,
Expand Down Expand Up @@ -149,3 +149,5 @@ export default ({
</svg>
);
};

export default Example;
4 changes: 3 additions & 1 deletion packages/visx-demo/src/sandboxes/visx-responsive/Lines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Props = {
height: number;
};

export default ({ width, height }: Props) => {
const Lines = ({ width, height }: Props) => {
// bounds
const lineHeight = height / lineCount;

Expand All @@ -52,3 +52,5 @@ export default ({ width, height }: Props) => {
</svg>
);
};

export default Lines;
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type LineRadialProps = {
animate?: boolean;
};

export default ({ width, height, animate = true }: LineRadialProps) => {
const Example = ({ width, height, animate = true }: LineRadialProps) => {
const lineRef = useRef<SVGPathElement>(null);
const [lineLength, setLineLength] = useState<number>(0);
const [shouldAnimate, setShouldAnimate] = useState<boolean>(false);
Expand Down Expand Up @@ -159,3 +159,5 @@ export default ({ width, height, animate = true }: LineRadialProps) => {
</>
);
};

export default Example;

0 comments on commit ffd7bf3

Please sign in to comment.