Skip to content

Commit

Permalink
Add comment re: future of Tooltip component
Browse files Browse the repository at this point in the history
  • Loading branch information
sirugh committed Mar 26, 2019
1 parent fb43b83 commit 93571ca
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import uuid from 'uuid/v4';
import classify from 'src/classify';
import defaultClasses from './swatchTooltip.css';

/**
* NOTE: The SwatchTooltip component, as created, needs to be a parent of the
* component it is a tooltip for. This is necessary for several reasons:
* - the Tooltip generates a uuid which is used for the aria-describedby
* - the Tooltip currently acts like a controller for event handlers.
*
* Once we move this component to a more general "Tooltip" component within
* Peregrine we may change the parent-child relationship pattern. Please be
* aware of this if you chose to reuse this component. -srugh
*/
class SwatchTooltip extends Component {
static propTypes = {
classes: shape({
Expand Down

0 comments on commit 93571ca

Please sign in to comment.