Closed joaom00 closed 8 months ago
When using the following code to add a "Create action", React throws Maximum update depth exceeded error because filtered.count will loop update between 0 and 1
Maximum update depth exceeded
filtered.count
const search = useCommandState((state) => state.search) const isEmpty = useCommandState((state) => state.filtered.count === 0) return isEmpty ? <Command.Item forceMount>Create {search}</Command.Item> : null
To fix this the Item is not registered to be filtered when forceMount is true
Item
forceMount
true
The latest updates on your projects. Learn more about Vercel for Git ↗︎
When using the following code to add a "Create action", React throws
Maximum update depth exceeded
error becausefiltered.count
will loop update between 0 and 1To fix this the
Item
is not registered to be filtered whenforceMount
istrue