Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating D3 into a Vite-TS Project #180

Open
AndrewTran03 opened this issue Feb 15, 2024 · 1 comment
Open

Integrating D3 into a Vite-TS Project #180

AndrewTran03 opened this issue Feb 15, 2024 · 1 comment

Comments

@AndrewTran03
Copy link

Uncaught TypeError: Cannot read properties of undefined (reading 'document')
    at react-d3-components.js?v=826b55c8:1102:30
    at node_modules/react-d3-components/node_modules/d3/d3.js (react-d3-components.js?v=826b55c8:11487:6)
    at __require (chunk-UV5CTPV7.js?v=826b55c8:9:50)
    at node_modules/react-d3-components/lib/DefaultPropsMixin.js (react-d3-components.js?v=826b55c8:11500:14)
    at __require (chunk-UV5CTPV7.js?v=826b55c8:9:50)
    at node_modules/react-d3-components/lib/BarChart.js (react-d3-components.js?v=826b55c8:12034:30)
    at __require (chunk-UV5CTPV7.js?v=826b55c8:9:50)
    at node_modules/react-d3-components/lib/index.js (react-d3-components.js?v=826b55c8:13656:21)
    at __require (chunk-UV5CTPV7.js?v=826b55c8:9:50)
    at react-d3-components.js?v=826b55c8:13713:16
import { useState, useEffect } from "react";
import ReactD3 from "react-d3-components";

const BarChart =  ReactD3.BarChart;

type Props = {};

const QuizStatistics: React.FC<Props> = (props) => {
  const [name, setName] = useState("");

  return <>
  </>;
};

export default QuizStatistics;

How would I use modern import syntax for React^18.2? I keep getting an undefined error.

@iamstratos
Copy link

I have the exact same issue and no solutions yet :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants