我正在尝试使用 Mantine 的 DatePickerInput在我的 React 应用程序中,但组件的渲染方式似乎存在问题。
库版本:
"react": "^18.2.0",
"@mantine/core": "^7.1.7",
"@mantine/dates": "^7.1.7",
实现:
<DatePickerInput
name={name}
placeholder={placeholder}
ref={ref}
value={value}
onChange={e => onChange(e ?? undefined)}
clearable
error={error?.message}
{...otherProps}
/>
我检查了 css 文件中的某些样式是否出现异常,但这里的情况并非如此。我还尝试将 mantine 降级到 7.1.0
。
最佳答案
您需要像文档中提到的那样导入包的样式 – https://mantine.dev/dates/getting-started/#installation
import '@mantine/dates/styles.css';
关于reactjs - Mantine DatePickerInput 渲染错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77422657/