Reactotron: Convert some stateless components to functional component

Created on 29 Sep 2017  路  13Comments  路  Source: infinitered/reactotron

While working on pull request yesterday for migrating to prop types packages I have noticed that there are few components which are stateless and doesn't use lifecycle hooks.
I want to propose that can they be changed to functional component instead. I know its not a big deal but I could submit a PR for that if you like under hacktoberfest tag.

All 13 comments

Absolutely. I learned how to do React JS on this project so it's a bit messy.

sure I will start this weekend

@M-ZubairAhmed @skellock Would love to do some of these, mind splitting them?

I have submitted the PR for the files which were straight forward to convert to stateless function component. I hope @skellock will check them if it works for him.

@ericadamski sure i could definitely use some help.
i have not converted the following files to stateless components as they require a little bit more of testing. I will keep this issue open so you can continue your work.

  • Commands/AsyncStorageValuesCommand
  • Commands/ApiResponseCommand
  • Commands/SagaTaskCompleteCommand
  • All files under Dialogs/
  • Foundation/Backups
  • Foundation/Footer
  • Foundation/BakupsHeader
  • Foundation/HelpFeedback
  • Foundation/HelpHeader
  • Foundation/NativeHeader
  • Foundation/NativeOverlayMargins
  • Foundation/Sidebar
  • Foundation/Subscriptions
  • Foundation/SubscriptionHeader
  • Foundation/TimelineHeader
  • Foundation/VisualRoot
  • Shared/CommandToolbar
    There may be other which i must have missed.
    For example to remove mobx decorators from classes we can use HOC. i suggest you check out with the docs.

@ericadamski please see effected files in the PR to avoid merge conflict

@M-ZubairAhmed I will wait for that PR to be merged before I continue, that way we can completely avoid merge conflicts

sure sounds like a good idea

@M-ZubairAhmed @skellock just added a new PR updating only the App/Dialog so to avoid merge conflicts :) https://github.com/infinitered/reactotron/pull/522

@ericadamski i will keep this issue open for further discussion of the work you are doing.

I'm happy to close this too if you're done for now. I wanna make sure you get the hacktoberfest credits and it's big undertaking to convert them all.

@skellock sure please go ahead

Thank you very much again!

@skellock I have a friend I work with who is also interested in converting some of the components, I will also continue to work through them and put up PRs when time permits!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scally picture scally  路  5Comments

dhruwal picture dhruwal  路  3Comments

itaied246 picture itaied246  路  4Comments

skellock picture skellock  路  4Comments

fkereki picture fkereki  路  3Comments