javascript - chakra ui - the style does not apply - Stack Overflow

What I expect:What actually shows:The size is not the same as my expectation.App.jsimport ".sty

What I expect:

What actually shows:

The size is not the same as my expectation.

App.js

import "./styles.css";
import { HStack, PinInput, PinInputField } from "@chakra-ui/react";

export default function App() {
  return (
    <div className="App">
      <HStack>
        <PinInput type="alphanumeric">
          <PinInputField />
          <PinInputField />
          <PinInputField />
          <PinInputField />
        </PinInput>
      </HStack>
    </div>
  );
}

Codesandbox:
=/src/App.js

What I expect:

What actually shows:

The size is not the same as my expectation.

App.js

import "./styles.css";
import { HStack, PinInput, PinInputField } from "@chakra-ui/react";

export default function App() {
  return (
    <div className="App">
      <HStack>
        <PinInput type="alphanumeric">
          <PinInputField />
          <PinInputField />
          <PinInputField />
          <PinInputField />
        </PinInput>
      </HStack>
    </div>
  );
}

Codesandbox:
https://codesandbox.io/s/romantic-snowflake-km87e?file=/src/App.js

Share Improve this question asked Feb 15, 2022 at 9:28 CCCCCCCC 6,51110 gold badges61 silver badges144 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

It seems that you have forgotten the provider setup. Please make sure to read the setup in the documentation.

You should have the following code surrouding the App ponent, helping you fix the problem.

import { ChakraProvider } from '@chakra-ui/react'

<ChakraProvider>
  <App />
</ChakraProvider>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744081879a4555446.html

相关推荐

  • javascript - chakra ui - the style does not apply - Stack Overflow

    What I expect:What actually shows:The size is not the same as my expectation.App.jsimport ".sty

    8天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信