davidjbradshaw / iframe-resizer

Keep iFrames sized to their content.
https://iframe-resizer.com
Other
6.65k stars 981 forks source link

Conflicting deprecation warning vs typing of `onInit` in React library #1294

Closed FoodProduct closed 1 month ago

FoodProduct commented 1 month ago

Describe the bug At runtime, I receive the error message

Deprecated Option

The onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.

but the type IframeResizerProps has onInit and no onReady

To Reproduce

  1. Using @iframe-resizer/react@5.1.5, render an <IframeResizer> with an onInit in the props.
  2. Check dev console for warning logs

Expected behavior I expect either: onReady to be an available option in the props OR onInit to not throw a deprecation warning

Screenshots

Screenshot 2024-07-16 at 10 48 14 AM

Desktop (please complete the following information):

Additional context This might just be a discrepancy between the React version of the library and the underlying parent library. Thanks for the great library!

davidjbradshaw commented 1 month ago

Good spot, and just five minutes after I released v5.2 (Arrgh) :)

I will update the typings to onReady.

davidjbradshaw commented 1 month ago

Fixed v5.2.1