@@ -31,7 +31,6 @@ export interface CToasterProps extends HTMLAttributes<HTMLDivElement> {
3131}
3232
3333export const CToaster = forwardRef < HTMLDivElement , CToasterProps > (
34- //@ts -expect-error
3534 ( { children, className, placement, push, ...rest } , ref ) => {
3635 const [ toasts , setToasts ] = useState < ReactElement [ ] > ( [ ] )
3736 const index = useRef < number > ( 0 )
@@ -42,7 +41,7 @@ export const CToaster = forwardRef<HTMLDivElement, CToasterProps>(
4241 } , [ push ] )
4342
4443 // TODO: remove invisible items
45- const addToast = ( push : any ) => {
44+ const addToast = ( push : ReactElement ) => {
4645 setToasts ( ( state ) => [
4746 ...state ,
4847 React . cloneElement ( push , {
@@ -52,8 +51,6 @@ export const CToaster = forwardRef<HTMLDivElement, CToasterProps>(
5251 ] )
5352 }
5453
55- // a.splice(a.findIndex(e => e.name === "tc_001"),1);
56-
5754 const _className = classNames (
5855 'toaster toast-container p-3' ,
5956 {
@@ -77,15 +74,15 @@ export const CToaster = forwardRef<HTMLDivElement, CToasterProps>(
7774 ) : null
7875 }
7976
80- return placement
81- ? typeof window !== 'undefined' && createPortal ( toaster ( ref ) , document . body )
77+ return typeof window !== 'undefined' && placement
78+ ? createPortal ( toaster ( ref ) , document . body )
8279 : toaster ( ref )
8380 } ,
8481)
8582
8683CToaster . propTypes = {
87- children : PropTypes . any ,
88- className : PropTypes . any ,
84+ children : PropTypes . node ,
85+ className : PropTypes . string ,
8986 placement : PropTypes . oneOfType ( [
9087 PropTypes . string ,
9188 PropTypes . oneOf ( [
0 commit comments