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(vue3): delete source prop for img #3760

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export class HippyElement extends HippyNode {
* @param child - child node
* @param isHydrate - is hydrate or not
*/
public appendChild(child: HippyNode, isHydrate: boolean = false): void {
public appendChild(child: HippyNode, isHydrate = false): void {
// If the node type is text node, call setText method to set the text property
if (child instanceof HippyText) {
this.setText(child.text, { notToNative: true });
Expand Down Expand Up @@ -1024,26 +1024,6 @@ export class HippyElement extends HippyNode {
return style;
}

/**
* When generating props for Native Node, some additional logic needs to be hacked
*
* @param rawProps - original props
*/
private hackNativeProps(rawProps: NativeNodeProps) {
const props = rawProps;

// solve the problem of src props of iOS image, which should be repaired by native
if (this.tagName === 'img' && Native.isIOS()) {
props.source = [
{
uri: props.src,
},
];

props.src = undefined;
}
}

/**
* get the props of the Native node, the properties include the properties of the node and
* the default properties of the component to which the node belongs
Expand Down Expand Up @@ -1113,9 +1093,6 @@ export class HippyElement extends HippyNode {
});
}

// Finally handle the hack logic
this.hackNativeProps(props);

return props;
}

Expand Down
Loading