Giter Club home page Giter Club logo

Comments (12)

emorevival avatar emorevival commented on August 28, 2024 6

On NextJS I have fixed the issue by putting the import in a useEffect

useEffect(() => { import('tw-elements'); }, []);

from tw-elements.

ErnestDaDev avatar ErnestDaDev commented on August 28, 2024

Same issue...using React. You need to detail how to use it with React because the imports are not working

from tw-elements.

FelipeEndo avatar FelipeEndo commented on August 28, 2024

Same here with React. many CSS classes missing, like far, fa-calendar and datepicker-toggle-icon.
I'm using Tailwind 3.0 and React 17

from tw-elements.

emorevival avatar emorevival commented on August 28, 2024

Yeah I'm also having problems getting started with this on NextJS using TS, getting an error from /dist/js/index.min.js about document not being defined

from tw-elements.

smolenski-mikolaj avatar smolenski-mikolaj commented on August 28, 2024

@Victoria91 @BesavedTech @FelipeEndo

  1. Have you installed the latest 1.0.0-alpha8 version?
  2. Did you add the following configuration to your tailwind.config.js file?
module.exports = {
  content: ['./src/**/*.{html,js}', './node_modules/tw-elements/dist/js/**/*.js'],
  plugins: [
    require('tw-elements/dist/plugin')
  ]
}

Especially the content part with tw-elements js file is important, because some classes are added dynamically.

from tw-elements.

hamzahejaz avatar hamzahejaz commented on August 28, 2024

Can't use the time picker in react although included all of the files as described

from tw-elements.

ahmetskilinc avatar ahmetskilinc commented on August 28, 2024

@emorevival Where did you put this useEffect?

from tw-elements.

emorevival avatar emorevival commented on August 28, 2024

@ahmetskilinc If memory serves me well I put it in my index.tsx

from tw-elements.

wilychris avatar wilychris commented on August 28, 2024

after a year, i still need help..
following the official guide, stuck on point 4. i don't get where TW-ELEMENTS-PATH should point to.
i'm on:

  • react 18 ( without next.js nor vite )
  • tailwind 3.2.7
  • jsx

installed using npm, folder tw-elements is in 'node_modules' directory. so how do i point to that directory? i thought only 'src' is callable.

from tw-elements.

Trochonovitz avatar Trochonovitz commented on August 28, 2024

@wilychris ./node-modules/tw-elements/dist/js/index.min.js. Alternatively you can import library by calling import in useEffect hook in App.jsx.

  useEffect(() => {
    const use = async () => {
      await import("tw-elements");
    };
    use();
  }, []);

from tw-elements.

wilychris avatar wilychris commented on August 28, 2024

@wilychris ./node-modules/tw-elements/dist/js/index.min.js. Alternatively you can import library by calling import in useEffect hook in App.jsx.

  useEffect(() => {
    const use = async () => {
      await import("tw-elements");
    };
    use();
  }, []);

useEffect in App.jsx confirmed, tested, and works on windows chrome 109 and firefox 110.
many thanks @Trochonovitz

from tw-elements.

Trochonovitz avatar Trochonovitz commented on August 28, 2024

Hi, we just have launched bunch of integration tutorials - both with CSR and SSR frameworks. If you have more questions about integration or you still got some problems with particular components, let us know by adding new issue / topic in discussions section (if there are some unclear informations or just want let us know about something).

Next.js integration tutorial.

from tw-elements.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.