sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

FileTypeIcon Errors Out and Crashes Page

Open evan-buss opened this issue 1 year ago • 2 comments

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the documentation to see if your question is already addressed there. This will help us ensure our documentation is up to date.

Category

  • [ ] Enhancement
  • [x] Bug
  • [ ] Question

Version

Please specify what version of the library you are using: v3.18.1

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

After upgrading to v3.18.1 I'm getting this error when trying to use the FileTypeIcon component.

TypeError: Cannot add property onClick, object is not extensible
    at FileTypeIcon.render 

Observed Behavior

I expected it to render the file icons based on the given path, but it crashes the page.

Steps to Reproduce

Using SPFX 1.19.0, import and use the FileTypIcon component:

  <FileTypeIcon type={IconType.image} path={file.Filename} />

This seems to be related to the additional props that were added to this component in v3.18.0? Pull Request

Thanks!

evan-buss avatar Jun 12 '24 18:06 evan-buss