Skip to content

Integrating D3 into a Vite-TS Project #180

Open

Description

@AndrewTran03
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.

Activity

  1. iamstratos commented on Oct 9, 2024

    @iamstratos

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions