#Payload V3 , cant find import useField

14 messages · Page 1 of 1 (latest)

prime swallow
#

Hi there, does anyone know how can i import the useFIeld in V3? i only found the V2 version but its not working

import { useField } from 'payload/components/forms'

i know that they changed for some Elements to payloadcms/ui

import { Drawer, DrawerToggler } from '@payloadcms/ui/elements'
fiery violetBOT
prime swallow
#

Payload V3 , cant find import useField

velvet pawn
#

I am having the same problem rn. Any updates?

gilded bridge
#

Try this
import { useField } from "@payloadcms/ui";

velvet pawn
#

Thanks, but it seems to be some node_modules/dependencies problem itself. I've tried to reinstall node_modules and yet I still get an error of Module not found: Can't resolve ...

gilded bridge
#

What version of the beta are you on?

velvet pawn
#

Currently on beta.98, @trim halo/ui on beta.29(as it is the latest as far as i know). I've also tried adding the .nprmc with node-linker=hoisted and made sure that ui is under dependencies (not devDependencies). But nothing really works.

gilded bridge
#

All your payload packages needs to be on the same version

#

Here's how it should look

#

If you choose to go to 109 there will probably be breaking changes though

velvet pawn
# gilded bridge Here's how it should look

I don't really know what made me think that it had different versions. When i installed payload i had to manually install they ui package. Changing it to the right version made it work. Thanks!