I'm new to React and I have written some API call in component and when I try to add the imports in my main component it shows following error ERROR in ./src/containers/Ready_bricksapi.jsx Module not found: Error: Can't resolve 'exports' in 'D:\Brickzle (1)\src\containers'
@ ./src/containers/Ready_bricksapi.jsx 1:0-65
@ ./src/containers/homepage.jsx
@ ./src/containers/app-route.jsx
@ ./src/entry-points/client.jsx
@ multi webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/entry-points/client.jsx
import React, { Component } from 'react';
export class ReadyBricks extends Component {
Constructor(props) {
Super(props);
this.setState = {
bricksList: []
};
}
componentDidMount() {
this.readyBrick();
};
readyBrick() {
console.log("inside get api");
const url = '\'http://10.10.1.42:8070/api/user/brick/getBrickList?id=0\'';
fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'auth':'sdf345dvdfg4dfgdf435fghfhfg45123'
},
})
.then(function (response) {
let bricksList=response.results;
return bricksList;
console.log(bricksList);
})
.catch(function(error) {
console.log(JSON.stringify(error));
});
}
render() {
const ReadyBricks = this.state.bricksList.map((item) => {
return <div className="col-xs-12">
<div className="col-xs-6">
<p>Ready Brick Arts </p>
{item}
</div>
</div>
});
}
}
now my question is how to add this jsx file into my components