@@ -241,7 +241,7 @@ class Test extends React.Component {
241
241
"<ReactTooltip id='getContent' getContent={() => Math.floor(Math.random() * 100)} />" } </ p >
242
242
</ div >
243
243
< div >
244
- < p > { "<a data-for='overTime' data-tip>=( •̀д•́)</a>\naaaa " +
244
+ < p > { "<a data-for='overTime' data-tip>=( •̀д•́)</a>\n " +
245
245
"<ReactTooltip id='overTime' getContent={[() => {\n" +
246
246
" return 'Random length content'.slice(0, Math.floor(Math.random() * 21) + 1)\n" +
247
247
"}, 1000]}/>" } </ p >
@@ -304,14 +304,28 @@ class Test extends React.Component {
304
304
</ div >
305
305
< div className = "section" >
306
306
< h4 className = 'title' > Test SVG</ h4 >
307
+ < p > Note: if you dynamically change elements in the SVG, add:</ p >
308
+ < pre >
309
+ { " componentDidUpdate() {\n" +
310
+ " ReactTooltip.rebuild()\n" +
311
+ " }"
312
+ }
313
+ </ pre >
307
314
< p className = "sub-title" > </ p >
308
315
< div className = "example-jsx" >
309
- < div className = "side" >
316
+ < div className = "side" style = { { "textAlign" : "center" } } >
310
317
< svg data-tip = "=( •̀д•́)" data-for = "svgTooltip" width = "50" height = "50" >
311
318
< circle cx = "25" cy = "25" r = "22" fill = "#fff" stroke = "#000" strokeWidth = "4" />
312
319
</ svg >
313
320
< ReactTooltip id = 'svgTooltip' />
314
321
</ div >
322
+ < div className = "side" style = { { "textAlign" : "center" } } >
323
+ < svg width = "75" height = "50" >
324
+ < circle data-tip = "=( •̀‿•́)" data-for = "svgTooltip2" cx = "25" cy = "25" r = "22" fill = "#fff" stroke = "#000" strokeWidth = "4" />
325
+ < circle data-tip = "=( ❂‿❂)" data-for = "svgTooltip2" cx = "50" cy = "25" r = "16" fill = "#ddd" stroke = "#444" strokeWidth = "4" />
326
+ </ svg >
327
+ < ReactTooltip id = 'svgTooltip2' />
328
+ </ div >
315
329
</ div >
316
330
< br />
317
331
< pre className = 'example-pre' >
@@ -320,6 +334,13 @@ class Test extends React.Component {
320
334
" <circle cx='25' cy='25' r='22' fill='#fff' stroke='#000' strokeWidth='8'/>\n" +
321
335
"</svg>\n" +
322
336
"<ReactTooltip id='svgTooltip' />" } </ p >
337
+ < p > { "<svg width='75' height='50'>\n" +
338
+ "<circle data-tip='=( •̀‿•́)' data-for='svgTooltip2'\n" +
339
+ " cx='25' cy='25' r='22' fill='#fff' stroke='#000' strokeWidth='4'/>\n" +
340
+ "<circle data-tip='=( ❂‿❂)' data-for='svgTooltip2'\n" +
341
+ " cx='50' cy='25' r='16' fill='#fdf' stroke='#404' strokeWidth='4'/>\n" +
342
+ "</svg>\n" +
343
+ "<ReactTooltip id='svgTooltip2'/>" } </ p >
323
344
</ div >
324
345
</ pre >
325
346
</ div >
0 commit comments