Skip to content

Commit

Permalink
type(demo): fix streamgraph + line-radial type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Mar 11, 2020
1 parent 3f4ed74 commit a23fc68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -51,7 +51,7 @@ type Props = {
};

export default ({ width, height, animate = true }: Props) => {
const lineRef = useRef<SVGPathElement>();
const lineRef = useRef<SVGPathElement>(null);
const [lineLength, setLineLength] = useState<number>(0);
const [shouldAnimate, setShouldAnimate] = useState<boolean>(false);

Expand Down Expand Up @@ -119,7 +119,7 @@ export default ({ width, height, animate = true }: Props) => {

<LineRadial angle={angle} radius={radius} curve={curveBasisOpen}>
{({ path }) => {
const d = path(appleStock);
const d = path(appleStock) || '';
return (
<>
<animated.path
Expand Down
Expand Up @@ -106,8 +106,8 @@ export default function Streamgraph({ width, height, animate = true }: Props) {
const pattern = patternScale(stack.key);
return (
<g key={`series-${stack.key}`}>
<animated.path d={tweened.d} fill={color} />
<animated.path d={tweened.d} fill={`url(#${pattern})`} />
<animated.path d={tweened.d || ''} fill={color} />
<animated.path d={tweened.d || ''} fill={`url(#${pattern})`} />
</g>
);
})
Expand Down

0 comments on commit a23fc68

Please sign in to comment.