material-ui-dropzone icon indicating copy to clipboard operation
material-ui-dropzone copied to clipboard

It doesn't work with styled components

Open pedrokohler opened this issue 3 years ago • 1 comments

Bug Report

Describe the bug

It doesn't work with styled components. Simply no styling takes effect. I'm guessing it's because the className property passed to the component is not properly passed to the internal components.

Steps to reproduce

Do something like the code below

import styled from 'styled-components';
import { DropzoneArea as MuiDropZone } from 'material-ui-dropzone';
export const DropZoneArea = styled(MuiDropZone)`
  height: 100px;
  &.MuiDropzoneArea-textContainer{
    color: red;
  }
`;

You'll see that none of the styles are applied.

Expected behavior

Styles should be applied when using styled components.

Versions

  • OS: Ubuntu
  • Browser: Chrome
  • @material-ui/core version: 4.11.4
  • material-ui-dropzone version: 3.5.0
  • styled-components version: 5.3.0

pedrokohler avatar Jul 31 '21 13:07 pedrokohler

Use dropzoneClass prop to apply your styles. Example: <DropzoneArea dropzoneClass = classes.dropzone />

This works fine.

vikash-del avatar Aug 30 '21 05:08 vikash-del