From cb9d2e53e23ff0293652e5f9d7d7734f81b8ee08 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Sat, 4 May 2019 19:32:34 +0530 Subject: [PATCH] docs: Spelling mistakes correction --- src/decorators/staticMethods.js | 2 +- src/decorators/trackRemoval.js | 2 +- src/index.js | 10 +++++----- src/utils/getTipContent.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/decorators/staticMethods.js b/src/decorators/staticMethods.js index 9667a3de..505e7546 100644 --- a/src/decorators/staticMethods.js +++ b/src/decorators/staticMethods.js @@ -4,7 +4,7 @@ import CONSTANT from '../constant' const dispatchGlobalEvent = (eventName, opts) => { - // Compatibale with IE + // Compatible with IE // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work let event diff --git a/src/decorators/trackRemoval.js b/src/decorators/trackRemoval.js index f35e0711..5f869e34 100644 --- a/src/decorators/trackRemoval.js +++ b/src/decorators/trackRemoval.js @@ -1,6 +1,6 @@ /** * Tracking target removing from DOM. - * It's nessesary to hide tooltip when it's target disappears. + * It's necessary to hide tooltip when it's target disappears. * Otherwise, the tooltip would be shown forever until another target * is triggered. * diff --git a/src/index.js b/src/index.js index cf93f6f8..746ae487 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,7 @@ import React from 'react' import PropTypes from 'prop-types' import classname from 'classnames' -/* Decoraters */ +/* Decorators */ import staticMethods from './decorators/staticMethods' import windowListener from './decorators/windowListener' import customEvent from './decorators/customEvent' @@ -246,8 +246,8 @@ class ReactTooltip extends React.Component { } /** - * Invoke this before bind listener and ummount the compont - * it is necessary to invloke this even when binding custom event + * Invoke this before bind listener and unmount the component + * it is necessary to invoke this even when binding custom event * so that the tooltip can switch between custom and default listener */ unbindBasicListener (target) { @@ -366,7 +366,7 @@ class ReactTooltip extends React.Component { } /** - * When mouse hover, updatetooltip + * When mouse hover, update tool tip */ updateTooltip (e) { const {delayShow, disable} = this.state @@ -464,7 +464,7 @@ class ReactTooltip extends React.Component { } /** - * Add scroll eventlistener when tooltip show + * Add scroll event listener when tooltip show * automatically hide the tooltip when scrolling */ addScrollListener (currentTarget) { diff --git a/src/utils/getTipContent.js b/src/utils/getTipContent.js index 5e50efed..bceccd3b 100644 --- a/src/utils/getTipContent.js +++ b/src/utils/getTipContent.js @@ -16,7 +16,7 @@ import React from 'react' export default function (tip, children, getContent, multiline) { if (children) return children if (getContent !== undefined && getContent !== null) return getContent // getContent can be 0, '', etc. - if (getContent === null) return null // Tip not exist and childern is null or undefined + if (getContent === null) return null // Tip not exist and children is null or undefined const regexp = // if (!multiline || multiline === 'false' || !regexp.test(tip)) {