Yuvaleros/material-ui-dropzone

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 😀

image

Where can I read about what this does and how can I preserve its behaviour within functional components/ hooks. I am reading into this / investigating but if someone can help me out or point me in the right direction ti would be much appreciated 🤣

according to https://material-ui.com/styles/api/ these two appear to be analogous, still don't know what it does 🤣

image

2020-06-10_21h36_07

@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 on const {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 🕵️‍♀️