How to import and use NextUI components in a react app? #188
-
Hello dear NextUI devs; I have tried using the NextUI components in a demo react app; but I keep receiving errors; I don't know if I am doing it right. I will need some clarification. The error log is displayed here
Code from Layout.js (a component I am importing)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @Samsonroyal it's because you are not closing the first import * as React from 'react';
import { NextUIProvider } from '@nextui-org/react';
import { ReactComponent as Logo } from "./logo.svg";
import Posts from "./components/Posts";
import Layout from "./components/Layout";
import './App.css';
function App() {
return (
<div className="App">
<NextUIProvider>
<Layout />
</NextUIProvider>
<header className="App-header">
<Logo style={{ height: 200 }} />
<h1>Samson Galactic Posts</h1>
</header>
<Layout />
<Posts />
</div>
);
}
export default App; I hope it helps you 👍🏻 |
Beta Was this translation helpful? Give feedback.
Hey @Samsonroyal it's because you are not closing the first
Layout
tag, try doing it this way:I hope it helps you 👍🏻