Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed react native warning for deprecated defaultProps #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions AnimatableImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ function AnimatableImage(props) {

AnimatableImage.propTypes = Image.propTypes | Animated.Image.propTypes;

AnimatableImage.defaultProps = {
animated: false
};

export default AnimatableImage;
26 changes: 10 additions & 16 deletions AutoHeightImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import { NOOP, DEFAULT_HEIGHT } from './helpers';
// remove `resizeMode` props from `Image.propTypes`
const { resizeMode, ...ImagePropTypes } = AnimatableImage.propTypes;

function AutoHeightImage(props) {
const {
onHeightChange,
source,
width,
style,
maxHeight,
onError,
...rest
} = props;
function AutoHeightImage({
source,
width,
style,
onError,
maxHeight = Infinity,
onHeightChange = NOOP,
animated = false,
sbaiahmed1 marked this conversation as resolved.
Show resolved Hide resolved
...rest
}) {
const [height, setHeight] = useState(
getImageSizeFitWidthFromCache(source, width, maxHeight).height ||
DEFAULT_HEIGHT
Expand Down Expand Up @@ -82,10 +82,4 @@ AutoHeightImage.propTypes = {
animated: PropTypes.bool
};

AutoHeightImage.defaultProps = {
maxHeight: Infinity,
onHeightChange: NOOP,
animated: false
};

export default AutoHeightImage;
1 change: 0 additions & 1 deletion ImagePolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ function ImagePolyfill(props) {
}

ImagePolyfill.propTypes = AnimatableImage.propTypes;
ImagePolyfill.defaultProps = AnimatableImage.defaultProps;

export default ImagePolyfill;