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
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top