Skip to content

Add section about ReactTooltip.rebuild() to the docs #965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ In versions >=5.8.0, we've introduced the `data-tooltip-id` attribute, and the `

1 . Import the CSS file to set default styling.

> :warning: You must import the CSS file or the tooltip won't show!

```js
import 'react-tooltip/dist/react-tooltip.css'
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/examples/anchor-select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1

# Anchor select

Default color stylings available for the ReactTooltip component.
Using the ReactTooltip anchor select prop.

import { Tooltip } from 'react-tooltip'
import 'react-tooltip/dist/react-tooltip.css'
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ For more info and more complex use cases using `anchorSelect`, check [the exampl

### Set the default styling

:::caution

You must import the CSS file or the tooltip won't show!

:::

```js
import 'react-tooltip/dist/react-tooltip.css'
```
Expand Down
9 changes: 9 additions & 0 deletions docs/docs/upgrade-guide/changelog-v4-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ This resulted in a great improvement in performance, and made it easier for the
- `getContent` prop was removed. Instead, you can directly pass dynamic content to the `content` tooltip prop, or to `data-tooltip-content` in the anchor element
- Default behavior of tooltip now is equivalent to V4's `solid` effect, instead of `float`. The new `float` prop can be set to achieve V4's `effect="float"`. See [Options](../options.mdx) for more details

## What about `ReactTooltip.rebuild()`?

A common question V4 users have when upgrading to V5 is about `ReactTooltip.rebuild()`.
Rebuilding the tooltip was a required step when using V4 with dynamic content. It isn't necessary when using V5.

The tooltip component now automatically watches for any changes made to the DOM and updates accordingly, without any extra steps needed.

If you run into any problems with the tooltip not updating after changes are made in other components, please open a [GitHub issue](https://github.com/ReactTooltip/react-tooltip/issues/new/choose) reporting what you find, ideally with a sample [CodeSandbox](https://codesandbox.io/) (or something similar) to help us pinpoint the problem.

## New Props

- [x] `classNameArrow`
Expand Down