Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use custom style as way of the documentation #145

Open
KENNYSOFT opened this issue Feb 12, 2020 · 0 comments
Open

Cannot use custom style as way of the documentation #145

KENNYSOFT opened this issue Feb 12, 2020 · 0 comments

Comments

@KENNYSOFT
Copy link

https://github.com/ctxhou/react-tabtab#make-your-own-style

The document says:

Second: extend style and export it

import {styled} from 'react-tabtab';
let {TabListStyle, ActionButtonStyle, TabStyle, PanelStyle} = styled;

TabListStyle = styled(TabListStyle)`
 // write css
`;

TabStyle = styled(TabStyle)`
 // write css
`;

ActionButtonStyle = styled(ActionButtonStyle)`
 // write css
`;

PanelStyle = styled(PanelStyle)`
 // write css
`;

// need to follow this object naming
module.exports = {
 TabList: TabListStyle,
 ActionButton: ActionButtonStyle,
 Tab: TabStyle,
 Panel: PanelStyle
}

But styled is an object, so you cannot use this way. I used following way:

import styled from 'styled-components'
import {styled as tabtabStyle} from 'react-tabtab'
let {TabListStyle, ActionButtonStyle, TabStyle, PanelStyle} = tabtabStyle;

TabListStyle = styled(TabListStyle)`
  // write css
`;

TabStyle = styled(TabStyle)`
  // write css
`;

ActionButtonStyle = styled(ActionButtonStyle)`
  // write css
`;

PanelStyle = styled(PanelStyle)`
  // write css
`;

// need to follow this object naming
module.exports = {
  TabList: TabListStyle,
  ActionButton: ActionButtonStyle,
  Tab: TabStyle,
  Panel: PanelStyle
}

Please update the document. 😄

@KENNYSOFT KENNYSOFT changed the title Cannot use custom style as way of the document Cannot use custom style as way of the documentation Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant