GovTechSG / sgds-govtech-react

React components for SGDS
https://react.designsystem.tech.gov.sg/
MIT License
15 stars 6 forks source link

FileUpload.selectedFile variable type #160

Closed seng-siong closed 1 year ago

seng-siong commented 1 year ago

Can we avoid the use of {} here? https://github.com/GovTechSG/sgds-govtech-react/blob/3969c380ef7714fea24b620e1b402f87f28af909/src/FileUpload/FileUpload.tsx#L12C25-L12C33

it is difficult to write conditional logic with {}, sometimes I get errors like "This condition will always return 'false' since JavaScript compares objects by reference, not value." in typescript.

Either undefined or an empty FileList should be good.

Thank you.

clukhei commented 1 year ago

@seng-siong resolved in 2.2.1 https://github.com/GovTechSG/sgds-govtech-react/releases/tag/v2.2.1