diff --git a/src/decorators/staticMethods.js b/src/decorators/staticMethods.js index 9667a3de1..505e7546f 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 f35e07111..5f869e34a 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 cf93f6f81..746ae4876 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 5e50efed4..bceccd3b0 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)) {