Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Zod & React: 'Key' only refers to a type, but is being used as a value here

I have the following code set up for a Zod contract, and I'm getting this error message when trying to use Key and ReactElement. I'm not clear on what the solution is in this instance, and other examples of this error message aren't related to a Zod-based error so I'm not sure if they apply. The error I'm getting, I'm getting on both Key and ReactElement.

'Key' only refers to a type, but is being used as a value here

import { z } from "zod";
import { Key, ReactElement } from "react";


export const Foo= z.object({
    key: Key.optional(),
    children: ReactElement.array(),
    catId: z.string().optional(),
    identifier: z.string().optional(),
})

export type FooProps= z.infer<typeof Foo>
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda