Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda