Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divider renders without styles in first time #8360

Open
1 of 3 tasks
max10rogerio opened this issue Mar 14, 2024 · 0 comments
Open
1 of 3 tasks

Divider renders without styles in first time #8360

max10rogerio opened this issue Mar 14, 2024 · 0 comments
Labels
Topic: Color Mode 🌓 Issue or PR related to color mode

Comments

@max10rogerio
Copy link

max10rogerio commented Mar 14, 2024

Description

I'm using nextjs with app router in latest version

When I use the divider component, the divider renders without styles on the loading page. After the page fully loads, the styles are applied.

On loading page
image

After load page complete
image

Full Example

2024-03-14.11-20-56.mp4

On codesandbox example, you need refresh refresh then you see a black line for a moment.

Link to Reproduction

https://codesandbox.io/p/devbox/infallible-mahavira-ffjqmc?workspaceId=339403a7-df20-4695-bad9-9676ec52a704

Steps to reproduce

No response

Chakra UI Version

2.8.2

Browser

Google Chrome 122.0.6261.112

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

I'm using WSL

Update 1:

When I set the borderColor in theme that's work fine.

// ./theme.ts
import { extendTheme } from "@chakra-ui/react";

export const theme = extendTheme({
  components: {
    Divider: {
      baseStyle: {
        borderColor: "gray.200",
      },
    },
  },
});

// providers.tsx
"use client";

import { CacheProvider } from "@chakra-ui/next-js";
import { PropsWithChildren } from "react";
import { ChakraProvider } from "@chakra-ui/react";

export const Providers = (props: PropsWithChildren) => {
  return (
    <CacheProvider>
      <ChakraProvider theme={theme}>{props.children}</ChakraProvider>
    </CacheProvider>
  );
};
@segunadebayo segunadebayo added the Topic: Color Mode 🌓 Issue or PR related to color mode label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Color Mode 🌓 Issue or PR related to color mode
Projects
None yet
Development

No branches or pull requests

2 participants