0

I have try to create a webdatarocks basic table using React. But i have continuously encountered the following issues. Why this following error occurs. How to overcome this?enter image description here

  • That error is caused by attempting to do something like `undefined.prop`. Show your full code? – Bas May 26 '22 at 07:07
  • import * as WebDataRocksReact from "react-webdatarocks"; function App() { return (
    ); } export default App;
    – Abdul Bashith May 26 '22 at 07:12

1 Answers1

0

Here is a short guide on how to embed WebDataRocks in your React project:

  1. If you don’t have a React application yet, create one by running this command in the console:
    npx create-react-app my-app
    cd my-app
  2. Get the WebDataRocks React module from npm:
    npm install react-webdatarocks
  3. Add WebDataRocks’ styles to the src/index.js file:
    import 'webdatarocks/webdatarocks.css'
  4. Import the WebDataRocksReact module to the src/App.js file:
    import * as WebDataRocksReact from 'react-webdatarocks';
  5. Open src/App.js and add WebDataRocks there using the WebDataRocksReact.Pivot component:
function App() {
    return (
      <div className="App">
        <WebDataRocksReact.Pivot 
         toolbar={true}
         componentFolder="https://cdn.webdatarocks.com/"
         width="100%"
         report="https://cdn.webdatarocks.com/reports/report.json"
        />
      </div>
    );
}
  1. Run your application:
    npm start
  2. Open http://localhost:3000/ in the browser — WebDataRocks is embedded into your React project.
solja
  • 71
  • 4