I am uploading less code because I think it is enoug
Ask if need more to find error
async componentDidMount(){
var image = this.props.data.img
console.log(this.props.data.img == './../images/thumbnails/g.png') // true
console.log(this.props.data.img === './../images/thumbnails/g.png') // true
console.log(typeof(this.props.data.img))
await import(image)
.then((res)=>{
console.log(res)
this.setState({img:res})
})
.catch((e)=>{
console.log(this.props.data.img)
console.log(e)
})
}
I am trying to import image.
When i use import('./../images/thumbnails/g.png)
then it run successfully but when i pass same value as props and tries to import that then it through error (module not found).
I log the values and all are coming out to be true that mean string and string by props are same then why i am getting 2 different behavior?