Skip to content

Commit

Permalink
remove react-hot-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemedit committed Jul 24, 2020
1 parent 92c3869 commit 56bdc65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 102 deletions.
101 changes: 15 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"publishConfig": {
"access": "public"
},
"dependencies": {
"react-hot-loader": "^4.1.2"
},
"dependencies": {},
"peerDependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2",
Expand Down
15 changes: 2 additions & 13 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// their comparison function in case a consumer of these components is
// using hot module reloading
import * as React from "react";
import { areComponentsEqual } from "react-hot-loader";
import styled from "styled-components";

interface DropdownMenuProps {
Expand Down Expand Up @@ -92,23 +91,13 @@ export class DropdownMenu extends React.PureComponent<
<DropdownDiv onKeyUp={this.handleKeyUp}>
{React.Children.map(this.props.children, child => {
const childElement = child as React.ReactElement<any>;
if (
areComponentsEqual(
childElement.type as React.ComponentType<any>,
DropdownTrigger
)
) {
if (childElement.type === DropdownTrigger) {
return React.cloneElement(childElement, {
onClick: () => {
this.setState({ menuHidden: !this.state.menuHidden });
}
});
} else if (
areComponentsEqual(
childElement.type as React.ComponentType<any>,
DropdownContent
)
) {
} else if (childElement.type === DropdownContent) {
if (this.state.menuHidden) {
return null;
} else {
Expand Down

0 comments on commit 56bdc65

Please sign in to comment.