Skip to content

Commit

Permalink
feat: Fixed RenderToBody wrong attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
myxvisual committed Aug 10, 2017
1 parent e9bda35 commit e4abeb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions docs/src/routes/Home/components/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ function getStyles(categories: Categories): {
const { prefixStyle } = theme;

return {
root: prefixStyle({
...style
}),
root: prefixStyle(style),
categories: prefixStyle({
width: renderContentWidth,
display: "flex",
Expand Down
6 changes: 4 additions & 2 deletions src/RenderToBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default class RenderToBody extends React.Component<RenderToBodyProps> {
rootElm = document.createElement("div");
componentDidMount() {
const { style, className } = this.props;
Object.assign(this.rootElm, className ? { style, className } : { style });
Object.assign(this.rootElm.style, style);
if (className) this.rootElm.setAttribute("class", className);

document.body.appendChild(this.rootElm);
this.renderComponent();
Expand All @@ -20,7 +21,8 @@ export default class RenderToBody extends React.Component<RenderToBodyProps> {
componentDidUpdate() {
this.renderComponent();
const { style, className } = this.props;
Object.assign(this.rootElm, className ? { style, className } : { style });
Object.assign(this.rootElm.style, style);
if (className) this.rootElm.setAttribute("class", className);
}

componentWillUnmount() {
Expand Down

0 comments on commit e4abeb0

Please sign in to comment.