trying to add office-ui-fabric-react in a yo generated spfx webpart causes error on build

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/222728

  •  29-12-2020
  •  | 
  •  

Pregunta

I'm experiencing build errors when adding

 <TextField label='TextField with an icon' iconProps={ { iconName: 'Calendar' } } />    

resulting with this error on gulp build

Error - typescript - node_modules\office-ui-fabric-react\lib\components\Image\Image.Props.d.ts(3,43): error TS2694: Namespace 'React' has no exported member 'ImgHTMLAttributes'. Error - typescript - node_modules\office-ui-fabric-react\lib\components\TextField\TextField.Props.d.ts(24,47): error TS2694: Namespace 'React' has no exported member 'AllHTMLAttributes'. Error - 'typescript' sub task errored after 2.24 s "TypeScript error(s) occurred."

I think it may be because of the typescript compiler which is in version 2.2.2

Anybody experiencing the same?

¿Fue útil?

Solución

The latest OUIFR release is not compatible with SPFX at this point. You should install version 4.28.0 of OUIFR.

Licenciado bajo: CC-BY-SA con atribución
scroll top