Skip to content

Commit

Permalink
Bump react-aspect-ratio to support passing refs (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissantamaria authored Oct 8, 2023
1 parent 0390fb8 commit 04a33f0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"jest-environment-jsdom": "^29.3.1",
"jest-junit": "^15.0.0",
"react": "^18.0.0",
"react-aspect-ratio": "^1.0.3",
"react-aspect-ratio": "^1.1.6",
"react-dom": "^18.0.0",
"react-test-renderer": "^18.0.0",
"storybook": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/stories/common/Iframe.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import AspectRatio from 'react-aspect-ratio';
import { AspectRatio } from 'react-aspect-ratio';

import { handleViewport } from '../../index';
import type { InjectedViewportProps } from '../../lib/types';
Expand Down
4 changes: 1 addition & 3 deletions src/stories/common/IframeFunctional.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { memo, useEffect, useState } from 'react';
import AspectRatio from 'react-aspect-ratio';
import { AspectRatio } from 'react-aspect-ratio';

import { handleViewport } from '../../index';
import type { InjectedViewportProps } from '../../lib/types';
Expand Down Expand Up @@ -33,8 +33,6 @@ function IframeFunctional(props: IframeFunctionalProps) {
<AspectRatio
ratio={ratio}
style={{ marginBottom: '200px', backgroundColor: 'rgba(0,0,0,.12)' }}
// @ts-expect-error
// TODO: fix upstream types in react-aspect-ratio to support ref
ref={forwardedRef}
>
<Component {...componentProps} />
Expand Down
2 changes: 1 addition & 1 deletion src/stories/common/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import AspectRatio from 'react-aspect-ratio';
import { AspectRatio } from 'react-aspect-ratio';

import { INIT, LOADING, LOADED } from './constants';
import { handleViewport } from '../../index';
Expand Down
4 changes: 1 addition & 3 deletions src/stories/common/ImageFunctional.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import AspectRatio from 'react-aspect-ratio';
import { AspectRatio } from 'react-aspect-ratio';

import { handleViewport } from '../../index';
import { INIT, LOADING, LOADED } from './constants';
Expand Down Expand Up @@ -57,8 +57,6 @@ function ImageObject(props: ImageObjectProps) {
marginBottom: '200px',
backgroundColor: getBackgroundColor(),
}}
// @ts-expect-error
// TODO: fix upstream types in react-aspect-ratio to support ref
ref={forwardedRef}
>
<img src={src} alt="demo" />
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7976,10 +7976,10 @@ rc@^1.2.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-aspect-ratio@^1.0.3:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-aspect-ratio/-/react-aspect-ratio-1.1.5.tgz#ee8e66cc45652156ced405469ddbdb4bdc54f18e"
integrity sha512-zTeQlhG584qDwr1wJi6dd9+zdvEbAWnKz0gSbxcmwIYitZ4Z2Dr9buJa9GONsh1BOO2ILZmMdVq6A/YvcKPN8A==
react-aspect-ratio@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/react-aspect-ratio/-/react-aspect-ratio-1.1.6.tgz#d949800ca1428194f98034b945f804ce3f4b3ec6"
integrity sha512-A7/x2MqpYelh2fxx6RnRSEcA+rwdfiDK74Ju78xW8EnzSGSopPnCugyKlB+2d6dNP1UzU/SscIslVtqzNZrwyQ==

react-colorful@^5.1.2:
version "5.6.1"
Expand Down

0 comments on commit 04a33f0

Please sign in to comment.