@klarna/react-native-vector-drawable
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -10,2 +10,12 @@ # Changelog | ||
## [0.4.0] - 2022-07-15 | ||
### Added | ||
- Fabric implementation. | ||
### Fixed | ||
- Removed redundant cast causing "BitmapDrawable cannot be cast to VectorDrawable". | ||
## [0.3.0] - 2021-05-21 | ||
@@ -49,3 +59,4 @@ | ||
[unreleased]: https://github.com/klarna-incubator/react-native-vector-drawable/compare/v0.3.0...HEAD | ||
[unreleased]: https://github.com/klarna-incubator/react-native-vector-drawable/compare/v0.4.0...HEAD | ||
[0.4.0]: https://github.com/klarna-incubator/react-native-vector-drawable/compare/v0.3.0...v0.4.0 | ||
[0.3.0]: https://github.com/klarna-incubator/react-native-vector-drawable/compare/v0.2.1...v0.3.0 | ||
@@ -52,0 +63,0 @@ [0.2.1]: https://github.com/klarna-incubator/react-native-vector-drawable/compare/v0.2.0...v0.2.1 |
{ | ||
"name": "@klarna/react-native-vector-drawable", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Android vector drawables in React Native", | ||
@@ -27,4 +27,5 @@ "main": "src", | ||
"devDependencies": { | ||
"@types/react-native": "^0.67.8", | ||
"prettier": "^2.2.1" | ||
} | ||
} |
@@ -17,2 +17,13 @@ # react-native-vector-drawable | ||
<!-- Taken from https://github.com/software-mansion/react-native-screens/blob/main/README-Fabric.md --> | ||
### Fabric installation | ||
This library supports React Native New Architecture (aka Fabric). To use this library with your Fabric application, you have to: | ||
1. Add latest `@klarna/react-native-vector-drawable` | ||
2. on iOS: | ||
- Install pods using `RCT_NEW_ARCH_ENABLED=1 pod install` – this is the same command you run to prepare a Fabric build but you also need to run it after a new native library gets added. | ||
3. on Android: | ||
- There are no additional steps required so long you app is configured to build with Fabric – this is typically configured by setting `newArchEnabled=true` in `gradle.properties` file in your project. | ||
## Usage | ||
@@ -55,3 +66,3 @@ | ||
Copyright © 2021 Klarna Bank AB | ||
Copyright © 2022 Klarna Bank AB | ||
@@ -58,0 +69,0 @@ For license details, see the [LICENSE](LICENSE) file in the root of this project. |
import { requireNativeComponent } from 'react-native'; | ||
const VectorDrawable = requireNativeComponent('RNVectorDrawable'); | ||
const isFabricEnabled = global.nativeFabricUIManager != null; | ||
export default VectorDrawable; | ||
const RNVectorDrawable = isFabricEnabled | ||
? require('./RNVectorDrawableNativeComponent').default | ||
: requireNativeComponent('RNVectorDrawable'); | ||
export default RNVectorDrawable; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38316
19
77
2
64