Answer the question
In order to leave comments, you need to log in
How to solve module not found in React component?
Good afternoon.
There are two components. They are located in ./src/components/
When I try to import another into one of the components, I get the module not found
error . it looks like this:
Component1
import React, { Component } from 'react';
class Component1 extends Component {
render() {
return (
'Component1'
)
}
}
export default Component1;
import Component1 from 'Component1';
class Component2 extends Component1 {
render() {
return (
'Component2'
)
}
}
export default Component2;
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