Skip to content

Commit

Permalink
fix: fix warning of React.use usage (#7008)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackySoul authored and actions-user committed Jun 11, 2024
1 parent 76e51c5 commit aa65e82
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vkui/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ export function isForwardRefElement<
* Ворнинга нет в React версии 19.*, поэтому пока поддерживаем 2 версии наименования
*/
export function getFetchPriorityProp(value: React.ImgHTMLAttributes<HTMLElement>['fetchPriority']) {
// @ts-expect-error: TS2339 Появится только в версии React >= 19.*
if (Boolean(React.use)) {
if (React.version.startsWith('19')) {
return { fetchPriority: value };
}
return { fetchpriority: value };
Expand Down

0 comments on commit aa65e82

Please sign in to comment.