Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 523 Bytes

FLOW.md

File metadata and controls

30 lines (22 loc) · 523 Bytes

FLow типизация

Примеры работы с withStyles

Для добавления типов стилей для объекта styles

const styles = {
  root: {color: 'red'}
};

type PropsType = {
  [$Keys<typeof styles>]: string
};

Для добавления типов стилей для функции styles

const styles = (theme: any) => ({
    root: {
        height: theme.sizing.appbarHeight,
    },
});

type PropsType = {
  [$Keys<$Call<typeof styles>>]: string
};