Skip to content

Commit

Permalink
Improve/add deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperManEver committed Mar 1, 2021
1 parent f7d99db commit 71de8f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-laag/src/Transition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useRef, useEffect } from "react";
import warning from "tiny-warning";

export type TransitionProps = {
isOpen: boolean;
Expand Down Expand Up @@ -39,6 +40,13 @@ export function Transition({
}
}, [isOpenExternal, setState]);

useEffect(() => {
warning(
children,
`react-laag: You are using 'Transition'. Note that this component is marked as deprecated and will be removed and a possible future release`
);
}, [children]);

useEffect(() => {
didMount.current = true;
}, []);
Expand Down

0 comments on commit 71de8f3

Please sign in to comment.