Skip to content

How to import and use NextUI components in a react app? #188

Answered by jrgarciadev
Samsonroyal asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Samsonroyal it's because you are not closing the first Layout tag, try doing it this way:

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 👍🏻

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Samsonroyal
Comment options

@etherealsunshine
Comment options

Answer selected by jrgarciadev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants