rax-image
Advanced tools
Comparing version 2.2.1-beta.0 to 2.2.1
@@ -0,3 +1,4 @@ | ||
/// <reference types="rax" /> | ||
import { ImageProps } from './types'; | ||
declare function Image({ source, fallbackSource, onLoad, onError, style, resizeMode, ...otherProps }: ImageProps): JSX.Element; | ||
export default Image; |
@@ -54,14 +54,10 @@ "use strict"; | ||
nativeProps.onLoad = (0, _rax.useCallback)(function (e) { | ||
if (e.success !== null && e.success !== undefined) { | ||
if (e.success) { | ||
onLoad && onLoad(e); | ||
} else { | ||
onError && onError(e); | ||
} | ||
} else if (e.currentTarget != null) { | ||
if (e.currentTarget.naturalWidth > 1 && e.currentTarget.naturalHeight > 1) { | ||
onLoad && onLoad(e); | ||
} else { | ||
onError && onError(e); | ||
} | ||
if (e && e.success) { | ||
// weex | ||
onLoad && onLoad(e); | ||
} else if (e && e.currentTarget && e.currentTarget.naturalWidth > 1 && e.currentTarget.naturalHeight > 1) { | ||
// web | ||
onLoad && onLoad(e); | ||
} else { | ||
onError && onError(e); | ||
} | ||
@@ -68,0 +64,0 @@ }, [onLoad, onError]); |
{ | ||
"name": "rax-image", | ||
"version": "2.2.1-beta.0", | ||
"version": "2.2.1", | ||
"description": "Image component for Rax.", | ||
@@ -10,6 +10,5 @@ "license": "BSD-3-Clause", | ||
"clean": "rm -rf ./lib ./package-lock.json ./demo/miniapp/lib ", | ||
"build": "npm run clean && rax-scripts build", | ||
"start": "rax-scripts start", | ||
"prepublishOnly": "npm run build", | ||
"test": "npm run build && rax-scripts test" | ||
"build": "npm run clean && ../../node_modules/.bin/build-scripts build --config ../../build.json", | ||
"start": "../../node_modules/.bin/build-scripts start --config ../../build.json", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -43,3 +42,3 @@ "files": [ | ||
"devDependencies": { | ||
"@rax-types/rax": "^1.0.5", | ||
"@types/rax": "^1.0.0", | ||
"@types/ali-app": "^1.0.0", | ||
@@ -54,4 +53,2 @@ "@types/jest": "^24.0.12", | ||
"rax": "^1.0.0", | ||
"rax-plugin-component": "^0.1.9", | ||
"rax-scripts": "^2.0.0", | ||
"rax-test-renderer": "^1.0.0", | ||
@@ -58,0 +55,0 @@ "rax-text": "^1.0.1", |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13
0
46319
984