Answer the question
In order to leave comments, you need to log in
How to import data correctly?
Import data and pass to components:
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/app/App';
import { tickets } from './data/tickets.json';
ReactDOM.render(
<React.StrictMode>
<App tickets={tickets} />
</React.StrictMode>,
document.getElementById('root')
);
ERROR in ./src/index.tsx 11:13-20
Should not import the named export 'tickets' (imported as 'tickets') from default-exporting module (only default export is available soon)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question