最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Missing Component equivalent to FormLabel in Chakra UI 3 - Stack Overflow

programmeradmin1浏览0评论

I have been migrating my projects from Chakra UI v2 to v3, following the Migration to v3 page, but I am unsure how to migrate some components which do not have their equivalent in v3. For instance FormLabel doesn't appear to be allowed to be imported anymore: export 'FormLabel' (imported as 'FormLabel') was not found in '@chakra-ui/react'

While some components have been specifically repurposed elsewhere (e.g. FormControl into Field), it's not clear what to do here. Thanks!

Here's a fraction of my form which I have started migrating, but FormLabel still bugs me:

<Field.Root isInvalid={formik.touched.email && !!formik.errors.email}>
  <FormLabel htmlFor="email">Email Address</FormLabel>
  <Input
    id="email"
    name="email"
    type="email"
    {...formik.getFieldProps("email")}
  />
  <Field.ErrorText>{formik.errors.email}</Field.ErrorText>
</Field.Root>
发布评论

评论列表(0)

  1. 暂无评论