How to use react-onclickoutside - 10 common examples

To help you get started, we’ve selected a few react-onclickoutside examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-onclickoutside_v6.x.x / flow_v0.57.1-v0.88.0 / test_react-onclickoutside_v6.x.x.js View on Github external
//@flow

import React from 'react';
import onClickOutside, { IGNORE_CLASS_NAME } from 'react-onclickoutside';

IGNORE_CLASS_NAME.slice();

// $ExpectError Cannot perform arithmetic operation because string literal `ignore-react-onclickoutside` [1] is not a number.
IGNORE_CLASS_NAME - 1;

// class and const are in same line to make all flow versions unhappy in the same line.
// $ExpectError Cannot call `onClickOutside` because string [1] is incompatible with boolean [2].
class FailComponent extends React.Component&lt;{ preventDefault: string }&gt; {render() {return <div>;}} const FailComponentWithClickOutside = onClickOutside(FailComponent);
;

class A extends React.Component&lt;{a: string, preventDefault: boolean }&gt; {
  render() {
    return this.props.preventDefault ? <div>{this.props.a}</div> : null;
  }
}

const B = onClickOutside(A);</div>
github ruhulamindev / samsung-notes-web / src / containers / editor / App.js View on Github external
changeCategoryEditMode: _ => dispatch({ type: "CATEGORY_EDITMODE" }),
  addCategory: _ => dispatch(addCategory(_)),
  addNote: (..._) => dispatch(noteSubmit(..._)),
  starChange: _ => dispatch(starFilter()),
  lockChange: _ => dispatch(lockFilter(_)),
  editorReset: _ => dispatch({ type: "RESET_EDITOR" }),
  noteChange: _ => dispatch(noteChange(_)),
  titleChange: _ => dispatch(titleChange(_))
});

// @ts-ignore
export default withRouter(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(onClickOutside(MainForm))
);
github vtex / react-jsonschema-table / src / components / fixedtoolbar / search / Search.react.js View on Github external
return _.find(
      this.props.fields,
      op => op.title === filter.field || op.label === filter.field
    ).name
  }
}
Search.propTypes = {
  fields: PropTypes.object,
  onSearch: PropTypes.func,
  indexedFields: PropTypes.array,
}
Search.contextTypes = {
  intl: PropTypes.object.isRequired,
}

export default onClickOutside(Search)
github googlefonts / korean / app / components / DropdownFontSelectorMenu.js View on Github external
);
          })
        }
      
    );
  }
}

let mapStateToProps = state =&gt; {
  return {
    currentDescFont: state.currentDescFont,
    locale: state.locale,
    currentDescFontSelected: state.currentDescFontSelected
  }
}
export default connect(mapStateToProps)(onClickOutside(DropDownFontSelectorMenu));
github ehrishirajsharma / SwiftnessX / app / components / tools / Editor.js View on Github external
'size',
  'color',
  'font',
  'link',
  'image',
  'video',
  'width',
  'height',

  'table',
  'contain',
  'tr',
  'td'
];

export default onClickOutside(Editor);
github ehrishirajsharma / SwiftnessX / app / components / middle / Item.js View on Github external
id={item.id}
                disabled={this.state.disabled}
                tagName="span"
                html={item.title}
                onBlur={this.handleBlur}
                onChange={e =&gt; this.props.renameItem(item.id, e.target.value)}
              /&gt;
            
          )}
        
      
    );
  }
}

export default onClickOutside(Item);
github anhthii / Echo / app / components / HomePage / Choices.js View on Github external
<li>{datas[key]}</li>
              )
            }
          
        }
      
    );
  }
}

Choices.propTypes = {
  fetchTracks: PropTypes.func.isRequired,
  activeChoiceId: PropTypes.string,
};

export default onClickOutside(Choices);
github ZackingIt / Mello / frontend / components / head / board_sharing_dropdown.jsx View on Github external
);
   }
   return (
     <section>
       <button>
         <i></i>
       </button>
       {boardSharingModal}
     </section>
   );
 }
}


export default onClickOutside(BoardSharingDropdown);
github anhthii / Echo / app / components / Modal / index.js View on Github external
return (
      <div>
        {this.renderModal()}
      </div>
    );
  }
}

Modal.propTypes = {
  dispatch: PropTypes.func.isRequired,
  playlists: PropTypes.array.isRequired,
  song: PropTypes.object.isRequired,
  authenticated: PropTypes.bool.isRequired,
};

export default onClickOutside(Modal);
github tomerovadia / Airbnfarm / frontend / components / main / user_settings_dropdown.jsx View on Github external
Account Settings
          My Guidebook
          Gift Cards
          Business Travel
          Log Out

        
      
    )

  }


}

export default onClickOutside(UserSettingsDropdown);

react-onclickoutside

An onClickOutside wrapper for React components

MIT
Latest version published 8 months ago

Package Health Score

79 / 100
Full package analysis