Skip to content

Commit 6f5f66c

Browse files
chore: add link to docs on deprecation warnings
1 parent d4ab568 commit 6f5f66c

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ yarn add react-tooltip
4646

4747
## Usage
4848

49+
> :warning: If you were already using `react-tooltip<=5.7.5`, you'll be getting some deprecation warnings regarding the `anchorId` prop and some other features.
50+
In versions >=5.8.0, we've introduced the `data-tooltip-id` attribute, and the `anchorSelect` prop, which are our recommended methods of using the tooltip moving forward. Check [the docs](https://react-tooltip.com/docs/getting-started) for more details.
51+
4952
### Using NPM package
5053

5154
1 . Import the CSS file to set default styling.
@@ -68,7 +71,7 @@ or if you want to still use the name ReactTooltip as V4:
6871
import { Tooltip as ReactTooltip } from 'react-tooltip'
6972
```
7073

71-
3 . Add `data-tooltip-content="<your placeholder>"` and `data-tooltip-id="<tooltip id>"` to your element.
74+
3 . Add `data-tooltip-id="<tooltip id>"` and `data-tooltip-content="<your placeholder>"` to your element.
7275

7376
> `data-tooltip-id` is the equivalent of V4's `data-for`.
7477

src/components/Tooltip/TooltipTypes.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export interface ITooltip {
4343
id?: string
4444
variant?: VariantType
4545
/**
46-
* @deprecated Use `anchorSelect` instead (TODO: link to docs page)
46+
* @deprecated Use `anchorSelect` instead.
47+
* See https://react-tooltip.com/docs/examples/anchor-select
4748
*/
4849
anchorId?: string
4950
anchorSelect?: string

src/components/TooltipController/TooltipControllerTypes.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export interface ITooltipController {
2121
id?: string
2222
variant?: VariantType
2323
/**
24-
* @deprecated Use `anchorSelect` instead (TODO: link to docs page)
24+
* @deprecated Use `anchorSelect` instead.
25+
* See https://react-tooltip.com/docs/examples/anchor-select
2526
*/
2627
anchorId?: string
2728
anchorSelect?: string

src/components/TooltipProvider/TooltipProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const DEFAULT_CONTEXT_DATA_WRAPPER: TooltipContextDataWrapper = {
3535
const TooltipContext = createContext<TooltipContextDataWrapper>(DEFAULT_CONTEXT_DATA_WRAPPER)
3636

3737
/**
38-
* @deprecated Use the tooltip `anchorSelect` prop instead (TODO: link to docs page)
38+
* @deprecated Use `anchorSelect` instead.
39+
* See https://react-tooltip.com/docs/examples/anchor-select
3940
*/
4041
const TooltipProvider: React.FC<PropsWithChildren> = ({ children }) => {
4142
const [anchorRefMap, setAnchorRefMap] = useState<Record<string, Set<AnchorRef>>>({

src/components/TooltipProvider/TooltipProviderTypes.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import type { ReactNode, RefObject } from 'react'
22
import type { ITooltipController } from 'components/TooltipController/TooltipControllerTypes'
33

44
/**
5-
* @deprecated Use the tooltip `anchorSelect` prop instead (TODO: link to docs page)
5+
* @deprecated Use `anchorSelect` instead.
6+
* See https://react-tooltip.com/docs/examples/anchor-select
67
*/
78
export type AnchorRef = RefObject<HTMLElement>
89

@@ -19,7 +20,8 @@ export interface TooltipContextDataWrapper {
1920
}
2021

2122
/**
22-
* @deprecated Use the tooltip `anchorSelect` prop instead (TODO: link to docs page)
23+
* @deprecated Use `anchorSelect` instead.
24+
* See https://react-tooltip.com/docs/examples/anchor-select
2325
*/
2426
export interface ITooltipWrapper {
2527
tooltipId?: string

src/components/TooltipProvider/TooltipWrapper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { useTooltip } from './TooltipProvider'
44
import type { ITooltipWrapper } from './TooltipProviderTypes'
55

66
/**
7-
* @deprecated Use the tooltip `anchorSelect` prop instead (TODO: link to docs page)
7+
* @deprecated Use `anchorSelect` instead.
8+
* See https://react-tooltip.com/docs/examples/anchor-select
89
*/
910
const TooltipWrapper = ({
1011
tooltipId,

0 commit comments

Comments
 (0)