We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fdd791 commit 2a497a8Copy full SHA for 2a497a8
src/react-toggle-pattern.js
@@ -1,23 +1,12 @@
1
// LICENSE : MIT
2
"use strict";
3
-import React, {Component, PropTypes} from 'react';
+import React from 'react';
4
5
-export default class TogglePattern extends Component {
+export default class TogglePattern extends React.Component {
6
getFlagNames() {
7
return Object.keys(this.props);
8
}
9
10
- getUnMatchedComponent() {
11
- const children = [].concat(this.props.children);
12
- const flagKeyNames = this.getFlagNames();
13
- return children.filter(child => {
14
- const childKeys = Object.keys(child.props);
15
- return childKeys.some(childKey => {
16
- return flagKeyNames.indexOf(childKey) == -1;
17
- });
18
19
- };
20
-
21
getMatchedComponent() {
22
const children = [].concat(this.props.children);
23
const flagKeyNames = this.getFlagNames();
0 commit comments