Skip to content

Commit

Permalink
适配RNOH 0.72.16(RNComponentFactory)
Browse files Browse the repository at this point in the history
  • Loading branch information
425765923 committed Mar 3, 2024
1 parent 5b96d44 commit b99ac64
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Binary file modified harmony/safe_area.har
Binary file not shown.
3 changes: 2 additions & 1 deletion harmony/safe_area/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"license": "ISC",
"types": "",
"devDependencies": {

},
"author": "",
"name": "safe_area",
"description": "Please describe the basic information.",
"main": "./index.ets",
"version": "1.0.0",
"version": "4.7.4-0.0.8",
"dependencies": {
"rnoh": "file:../rnoh"
}
Expand Down
10 changes: 6 additions & 4 deletions harmony/safe_area/src/main/ets/SafeAreaProvider.ets
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import {
Descriptor,
ComponentBuilderContext,
rnComponentFactoryBuilder,
RNComponentFactory,
RNOHContext,
ViewRawProps,
ViewBaseProps,
Expand Down Expand Up @@ -116,9 +116,11 @@ export struct SafeAreaProvider {
build() {
Stack() {
ForEach(this.descriptorWrapper?.childrenTags, (childrenTag: Tag) => {
rnComponentFactoryBuilder(this.ctx,
childrenTag,
this.ctx.rnInstance.getComponentNameFromDescriptorType(this.ctx.descriptorRegistry.getDescriptor(childrenTag)?.type))
RNComponentFactory({
ctx: this.ctx,
tag: childrenTag,
buildCustomComponent: this.buildCustomComponent
})
}, (tag: Tag) => tag.toString())
}
.attributeModifier(SafeAreaProviderModifier.getInstance().setDescriptor(this.descriptorWrapper))
Expand Down
10 changes: 6 additions & 4 deletions harmony/safe_area/src/main/ets/SafeAreaView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
RNOHContext,
ViewBaseProps,
Tag,
rnComponentFactoryBuilder,
RNComponentFactory,
ViewRawProps,
RNViewManager,
ViewDescriptorWrapperBase,
Expand Down Expand Up @@ -230,9 +230,11 @@ export struct SafeAreaView {
build() {
Stack() {
ForEach(this.descriptorWrapper?.childrenTags, (childrenTag: Tag) => {
rnComponentFactoryBuilder(this.ctx,
childrenTag,
this.ctx.rnInstance.getComponentNameFromDescriptorType(this.ctx.descriptorRegistry.getDescriptor(childrenTag)?.type))
RNComponentFactory({
ctx: this.ctx,
tag: childrenTag,
buildCustomComponent: this.buildCustomComponent
})
}, (tag: Tag) => tag.toString())
}
.attributeModifier(SafeAreaViewModifier.getInstance().setDescriptor(this.descriptorWrapper))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-tpl/react-native-safe-area-context",
"version": "4.7.4-0.0.7",
"version": "4.7.4-0.0.8",
"description": "A flexible way to handle safe area, also works on Android and web.",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
Expand Down

0 comments on commit b99ac64

Please sign in to comment.