How can I add flowbite to the React.Js . Followed the guide on the flowbite but components doesn't working well

4.8k Views Asked by At

Hello I used flowbite along with tailwindcss and react js But the components are not working in the react

(You can click the links to see the directory Images)

I imported the flowbite in the index.js

Created a components called Drp stands for dropdown and add a dropdown from the flowbite components section

This Drp component you can see in the image

Then this is my tailwind.config.js :

module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}", "./node_modules/flowbite/**/*.js"],
theme: {
extend: {},
 },
plugins: [
require('flowbite/plugin')
  ],
}

but this is not working ,How to fix this???

1

There are 1 best solutions below

0
On

Follow these points in "index.js" file:

Replace:

import ReactDOM from 'react-dom/client'; => import ReactDOM from 'react-dom';

User render method like:

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

enter image description here