question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Components doesn't work

See original GitHub issue

Hi I used the Button component and It didn’t apply style on it.

_app.tsx

import React from 'react'
import type { AppProps } from 'next/app'
import { VechaiProvider, Button } from '@vechaiui/react'

export default function App({ Component, pageProps }: AppProps) {
  return (
    <VechaiProvider>
      <Button>e</Button>
      <Component {...pageProps} />
    </VechaiProvider>
  )
}

tailwind.config.ts

export default {
  mode: 'jit',
  purge: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './node_modules/@vechaiui/**/*.{js,ts,jsx,tsx}',
  ],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [require('@tailwindcss/forms'), require('@vechaiui/core')],
}

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xingxinglieocommented, Jan 27, 2022

i forget add VechaiProvider, after adding it, some styles apply, but still any styles didn’t work,like color. But i really need a ui library, so i copy all styles from the website vechaiui.com 😂

1reaction
pepelelecommented, Nov 5, 2021

You must import tailwind styles in _app.tsx

import '../styles/globals.css';

globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;

You can check basic setup here: https://stackblitz.com/edit/nextjs-pvx8qa?file=pages%2Findex.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why my components don't display on my React page?
In routes.jsx file. I'm guessing it should lead to main page, but for some reason the route doesn't match and components in App.js ......
Read more >
REACT – Simple Intro Component Not Rendering?
The problem is that there are a few gotchas that make working with components difficult for those new to React.
Read more >
Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere ... Error boundaries work like a JavaScript catch {} block, but for components....
Read more >
FAQs - styled-components
If you think that the issue is in duplicated styled-components module somewhere in your dependencies, there are several ways to check this. You...
Read more >
Why React Child Components Don't Update on Prop Changes
In React, it's a common problem to have child components that don't re-render when you expect them to. In particular, a common problems...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found