Reputation: 733
BookStore is the parent component and the SearchBooks is the child component. It compiles well but I get a runtime error that the child component is not resolved.
BookStore.tsx (parent component)
import { SearchBooks, SearchParameters } from 'ClientApp/components/SearchBooks';
...
export class BookStore extends React.Component<RouteComponentProps<{}>, {}>
...
<SearchBooks searchForBooks={this.searchForBooks} />
SearchBooks.tsx
export class SearchBooks extends React.Component<IBookSearchProps>
...
Routes.tsx
...
<Route path='/bookStore' component={BookStore} />
File Tree:
Error:
ERROR in ./ClientApp/components/BookStore.tsx Module not found: Error: Can't resolve 'ClientApp/components/SearchBooks' in '...\ClientApp\components' @ ./ClientApp/components/BookStore.tsx 12:0-63 @ ./ClientApp/routes.tsx @ ./ClientApp/boot.tsx @ multi react-hot-loader/patch event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.tsx
Upvotes: 0
Views: 767
Reputation: 3411
import { SearchBooks, SearchParameters } from './SearchBooks';
Same directory components and the file is SearchBooks.
Upvotes: 1