asasvirtuais 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "asasvirtuais",
3
3
  "type": "module",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "description": "React form and action management utilities",
6
6
  "directories": {
7
7
  "packages": "./packages"
@@ -269,16 +269,14 @@ export function useSingleProvider<TSchema extends TableSchema>({
269
269
  }) {
270
270
  const { find, index } = useTable(table, schema)
271
271
  const [single, setSingle] = useState<z.infer<TSchema['readable']>>(
272
- // @ts-expect-error
273
- () => index[table][id]
272
+ () => index[id]
274
273
  )
275
274
  useEffect(() => {
276
275
  if (!single) find.trigger({ id }).then(setSingle)
277
276
  }, [])
278
277
  useEffect(() => {
279
- // @ts-expect-error
280
- setSingle(index[table][id as keyof typeof index])
281
- }, [index[table][id as keyof typeof index]])
278
+ setSingle(index[id])
279
+ }, [index[id]])
282
280
  return {
283
281
  id,
284
282
  single,