Migrate to Functional components and hooks
panz3r opened this issue · 9 comments
Task
With version 4.x having a minimum dependency on React 16.8
we can now rewrite all of the module code to take full advantage of Hooks
and simplify the internal code.
Hello 😀
according to https://material-ui.com/styles/api/ these two appear to be analogous, still don't know what it does 🤣
@max-carroll That’s actually the name for the MuiTheme style to apply to the component as override, should be possible to pass also to the makeStyles
method
@panz3r , I am part way through this, should hopefully have a pull request ready this week some time
I'm working on this again today sorry for delay
@panz3r , in PreviewList we destructure all the props together in the declaration of the function, however in other places we do it as and when they are required, I assumed we wanted to go the way of destructuring the props in the declaration, but just thought I would double check before I create pull request
- destructuring props in function brackets, e.g.
const myComponent = ({all, of, the, props})
- destructuring as and when props or required like this
const myComponent = (props) =>
and then later onconst {subset, of, props} = props
Hi @max-carroll ,
I’d go with destructuring in the initial declaration to have all the props always available and to keep the definitions clearer.
👍
@panz3r Pull request ready for review 🕵️♀️