Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Escriba '{ etiqueta: cadena; }' no se puede asignar al tipo 'IntrinsicAttributes & { children?: ReactNode; }'

Estoy usando Fluent UI, importé el componente Toggle y obtuve un UI Toggle exportado:

 export const UIToggle: React.FunctionComponent = () => { return ( <Stack tokens={stackTokens}> <Toggle label="Enabled and checked" defaultChecked onText="On" offText="Off" /> </Stack> ); };

pero cuando quiero usarlo y actualizar el atributo 'etiqueta':

 <UIToggle label = "Turn on"></UIToggle>

aquí está el error:

 Type '{ label: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'. Property 'label' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'

¿Alguien puede explicar por qué aparece este error y cómo puedo solucionarlo?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesito proporcionar una etiqueta como argumento para la interfaz. Con la siguiente revisión, está funcionando bien ahora.

 import * as React from 'react'; import { Stack, IStackTokens } from '@fluentui/react/lib/Stack'; import { Toggle } from '@fluentui/react/lib/Toggle'; const stackTokens: IStackTokens = { childrenGap: 10 }; interface ILabels { label: string } export const UIToggle: React.FunctionComponent<ILabels> = (props) => { return ( <Stack tokens={stackTokens}> <Toggle label={props.label} defaultChecked onText="On" offText="Off" /> </Stack> ); };
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!