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

127
Vistas
React: Property 'Item' does not exist on type

Trying to resolve this tsconfig issue but unsure how to proceed:

Property 'Item' does not exist on type '{ ({ children, spacing }: { children: any; spacing: any; }): Element; propTypes: { children: Requireable<ReactNodeLike>; spacing: Requireable<string>; };

Basically I have the element called Stack that looks like this:

const Stack = ({ children, spacing }) => {
      const items = findChildrenByRole(children, 'Stack.Item');

  return children ? <div>{items}</div> : null;
    };
    
    Stack.propTypes = {
      children: T.node,
      spacing: T.oneOf(['none', 's', 'm', 'l']),
    };
    
    Stack.defaultTypes = {
      spacing: 'none',
    };
    
    export default Stack;

I think have an ìndex.js file like this:

import Stack from './Stack';
import Item from './SubComponents/Item';

Stack.Item = Item;

export { Stack };

I use it like this:

<Stack spacing="s">
  <Stack.Item>
    Item
  </Stack.Item>
</stack>

How do i make it understand that Item exists in my vscode?

about 4 years ago · Juan Pablo Isaza
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