From 099e64632e5d305176461de651c0e0b68b424ddf Mon Sep 17 00:00:00 2001 From: matthewliuswims Date: Fri, 2 Nov 2018 23:01:46 -0500 Subject: [PATCH] added a more robust (but succinct) e.g. of showing/hiding tooltip in the readme --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 18dfaeb..a1f5e3a 100644 --- a/README.md +++ b/README.md @@ -171,14 +171,26 @@ You can use `interactive` prop and `html` for your interactive tooltip ## Show/hide your tooltip manually ```javascript + +state = { + open: false, +} + +// ... + {console.log('call'); setIsOpen(false)}} + open={this.state.open} > - { setIsOpen(true) }}> - This will show {tooltipContent} - +

{ + this.setState(state => ({ + open: !state.open, + })); + setTimeout(() => alert('can do things after delay'), 2000); + }} + > + Clicking me will initiate manual open/close tooltip logic +

```