Skip to content

Conversation

@andyyvo
Copy link
Contributor

@andyyvo andyyvo commented Jun 5, 2022

What: Closes #7465 -- All examples for the File Upload component have been converted from JavaScript to TypeScript. Additionally, all class components have been converted into functional components.

Additional issues: N/A

@patternfly-build
Copy link
Collaborator

patternfly-build commented Jun 5, 2022

@andyyvo andyyvo changed the title converted all file upload js examples to ts chore(FileUpload): convert examples to TypeScript/functional components Jun 7, 2022
const [value, setValue] = React.useState(null);
const [filename, setFilename] = React.useState('');

const handleFileInputChange = (_event, file) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add types to the parameters of all these helper functions that are passed as props to the component? It helps us check that our components are handling the prop types correctly and helps communicate more clearly to the consumers which types they should be using.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great! I just typed all of the helper functions :D

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tlabaj tlabaj merged commit 88c382a into patternfly:main Jun 13, 2022
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.60.16
  • @patternfly/react-catalog-view-extension@4.72.16
  • @patternfly/react-charts@6.74.16
  • @patternfly/react-code-editor@4.62.16
  • @patternfly/react-console@4.72.16
  • @patternfly/react-core@4.221.16
  • @patternfly/react-docs@5.82.16
  • @patternfly/react-icons@4.72.16
  • @patternfly/react-inline-edit-extension@4.66.16
  • demo-app-ts@4.181.16
  • @patternfly/react-integration@4.183.16
  • @patternfly/react-log-viewer@4.66.16
  • @patternfly/react-styles@4.71.16
  • @patternfly/react-table@4.90.16
  • @patternfly/react-tokens@4.73.16
  • @patternfly/react-topology@4.68.16
  • @patternfly/react-virtualized-extension@4.68.16
  • transformer-cjs-imports@4.59.16

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File upload: convert examples to TypeScript

4 participants