pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
383 stars 380 forks source link

FileTypeIcon Errors Out and Crashes Page #1833

Open evan-buss opened 3 months ago

evan-buss commented 3 months ago

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

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!

github-actions[bot] commented 3 months ago

Thank you for submitting your first issue to this project.

evan-buss commented 3 months ago

I rolled back to SPFX 1.18.2 and it also has the same error and crashes the page.