---
title: "Comment by Ole Spaarmann on \"Understanding Dynamic imports, Lazy and Suspense using React Hooks\" | Hashnode"
description: "Hey Tapas Adhikary , thanks for the great article. I think a small error prevented your example from working for me. You need to return the imported component i"
url: "https://hashnode.com/posts/understanding-dynamic-imports-lazy-and-suspense-using-react-hooks/5f2937e709567e0dc187f46f/comment/63931aba855b6005fa6c14c3"
---

[Discussion](https://hashnode.com/posts/understanding-dynamic-imports-lazy-and-suspense-using-react-hooks/5f2937e709567e0dc187f46f)

Comment [Understanding Dynamic imports, Lazy and Suspense using React Hooks](https://hashnode.com/posts/understanding-dynamic-imports-lazy-and-suspense-using-react-hooks/5f2937e709567e0dc187f46f)

[Ole Spaarmann](https://hashnode.com/@olespaarmann)

[Dec 9, 2022](https://hashnode.com/posts/understanding-dynamic-imports-lazy-and-suspense-using-react-hooks/5f2937e709567e0dc187f46f/comment/63931aba855b6005fa6c14c3)

Hey [Tapas Adhikary](https://hashnode.com/@atapas), thanks for the great article. I think a small error prevented your example from working for me. You need to return the imported component in `importDemo`

```
const importDemo = file =>
  return lazy(() =>
    import(`./demo/${file}`)
      .catch(() => console.log('Error in importing'))
);
```
