Exploring Sanity? Take control of your content – watch the demo

Issue with Sanity UI Autocomplete component custom rendering

5 replies
Last updated: Dec 5, 2024
The
Autocomplete
component from
@sanity/ui
crashes with custom rendering.Im trying to implement this:
https://www.sanity.io/ui/docs/component/autocomplete#example-with-custom-rendering The first example works, but the example with custom rendering fails with "Error: Constructor requires 'new' operator".Any ideas?
Dec 3, 2024, 10:26 AM
Hi thereπŸ‘‹
Is this resolved with the @sanity/ui@2.9.1 update?
Dec 4, 2024, 6:11 PM
Hi
user J
Unfortunately the issue stil remains after I update to 2.9.1.
Dec 5, 2024, 8:34 AM
I figured it out. It's actually the <Text> component which causes the issue.
Dec 5, 2024, 8:41 AM
I figured it out. Its so stupid! it was the <Text> component. And the auto importer in vim mistook it for the
Text()
constructor (https://developer.mozilla.org/en-US/docs/Web/API/Text ). I hadn't properly imported the Text component. πŸ˜›
Dec 5, 2024, 8:46 AM
Happy to hear that it’s working now!
Dec 5, 2024, 1:43 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?