【问题标题】:How can I add flowbite to the React.Js . Followed the guide on the flowbite but components doesn't working well如何将 flowbite 添加到 React.Js 。遵循 flowbite 上的指南,但组件无法正常工作
【发布时间】:2022-06-18 15:10:53
【问题描述】:

你好,我使用 flowbite 和 tailwindcss 和 react js 但是组件在 react 中不起作用

(可以点击链接查看图片目录)

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

那么这是我的 tailwind.config.js :

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

但这不起作用,如何解决这个问题???

【问题讨论】:

标签: reactjs tailwind-css flowbite


【解决方案1】:

在“index.js”文件中遵循以下几点:

替换:

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

用户渲染方法如:

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

【讨论】:

    猜你喜欢
    • 2019-11-16
    • 1970-01-01
    • 2022-10-16
    • 1970-01-01
    • 2023-02-14
    • 2022-10-15
    • 2022-10-18
    • 2022-09-29
    • 2020-02-28
    相关资源
    最近更新 更多