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

image 编译成 react-native 不支持base64 图片么? #11456

Closed
supermaverickws opened this issue Mar 15, 2022 · 10 comments · Fixed by #11459
Closed

image 编译成 react-native 不支持base64 图片么? #11456

supermaverickws opened this issue Mar 15, 2022 · 10 comments · Fixed by #11459
Assignees
Labels
enhancement New feature or request T-rn Target - 编译到 React Native
Milestone

Comments

@supermaverickws
Copy link

这个特性解决了什么问题?

image 编译成 react-native 不支持base64 图片么?

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Mar 15, 2022
@github-actions
Copy link
Contributor

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@zhiqingchen zhiqingchen added the T-rn Target - 编译到 React Native label Mar 16, 2022
@zhiqingchen
Copy link
Member

需要提供更多信息。rn是支持base64图片的

@supermaverickws
Copy link
Author

supermaverickws commented Mar 16, 2022

const ImageBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAwCAIAAABSYzXUAAAOf0lEQVR42u1aC0xUVxomrK6uxhCNxqa1qZHUjWYbu20aGxuN2dTU2BhXt812N200ur0IAkURQcAHReRdxOHhDDMMr2FgGGZgYJgHzAwvARmRh1brC2mLj/pWfFRU3O9yxjO34wh3xsqa7JycTM4993B0vu/+//f9545Xvae9As3LA4GHBk/z0OChwdNeCg11NXWKVEXu5lwhI5QES0qTSmuraj3gjikNNSU1khBJuaDcUGnAJQhQZakwo5VpPfiOEQ2IAyCuK9M5zBvUBsx7YmKMaEAuQhw4vYWYKI4r9kA8FjRAD0guerYhFKATHojHggZostt3X83WVFfXJxDcCQt7wjD3QkN/3LcPM2NNg17fUlLSbbE0/H9GAxC/GRV1NSamQ6XC2FpZeTk2diA8/GUz4UhDVlYvwzwJCfl1795LMtlRk6nx/0obEAfgwGESTCAmx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omNZWb3IVAgXp8TQwh6hA4awMiHhYnp6n0DQJxafAlXcjq3gsD00vGjDs48IyM8/DqABN3BHfDybzUbo+/b96KHhZTXoeVXVITCEghFPPVIWoiElpR9UcTtkBuHloeGVax4aPDR4mocGDw2e5qHhlWz/BchZWz/GCLenAAAAAElFTkSuQmCC"

布局
<Image src={ImageBase64} />

报错
image

@supermaverickws
Copy link
Author

@zhiqingchen
3.4.2 版
"@tarojs/taro-rn": "3.4.2",

@supermaverickws
Copy link
Author

image

@zhiqingchen

@zhiqingchen
Copy link
Member

尝试了下,是可以的

import { Image } from "@tarojs/components";
const ImageBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAwCAIAAABSYzXUAAAOf0lEQVR42u1aC0xUVxomrK6uxhCNxqa1qZHUjWYbu20aGxuN2dTU2BhXt812N200ur0IAkURQcAHReRdxOHhDDMMr2FgGGZgYJgHzAwvARmRh1brC2mLj/pWfFRU3O9yxjO34wh3xsqa7JycTM4993B0vu/+//f9545Xvae9As3LA4GHBk/z0OChwdNeCg11NXWKVEXu5lwhI5QES0qTSmuraj3gjikNNSU1khBJuaDcUGnAJQhQZakwo5VpPfiOEQ2IAyCuK9M5zBvUBsx7YmKMaEAuQhw4vYWYKI4r9kA8FjRAD0guerYhFKATHojHggZostt3X83WVFfXJxDcCQt7wjD3QkN/3LcPM2NNg17fUlLSbbE0/H9GAxC/GRV1NSamQ6XC2FpZeTk2diA8/GUz4UhDVlYvwzwJCfl1795LMtlRk6nx/0obEAfgwGESTCAmxpQGgaAvIOARmCDd1/+Ut1/HnwI63tjSviim7W9xbeszWgo0jQ5OSa/SO+xj1Bjddkq15oakip4IxYlPJRcWHbg6OenhhMTHC7OvFevbXDbTpWmijeNFARMlITNksYuV6V/py7NHWI9chDhwmGzXaJCdnK7vqkl7LBr/SDTxV8mMK7LFfcqvjuizfx9tQATI5T0pKf1fbLrlxRx+tk8MsKr1Dc/WDYCe5CJ1tpp/3WC21GdUde5QHl+Ve36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4Jrt0C9byFwaiyYgDAP2c903mE5URcE0c6V7r/tu3ZHnTlEArXKnTYzWUDjQOQFiktJnn1/hEfAmwMrKzfBaHlp4kNIi1h/m9cWuQbLPlmWy/yXEMs42p3MgMDGvJg8RdJlFMqPib17i6jUKP6ATPdit/vu3QQjQR2gC/RGQA6B82iKENqNS4uo1Cz7bAPRoI1otj22Cc1gpaSGGM1J9a0gTZoNZoQfQhlxwqchGe+klJjxSG0bXnLxnsYd8X+T+59DOAYYleIN/7SV70EmHQ7Gy/SQeY8VzouV2dn+qSpe6qSWMP9QoXXCr5BHYITz34IKcXTntPdcILvYu265imETS8t/MQpBjFMzrKbNQNK5NaM5VN9a63/ZpO0EDk4XlrRNqOBZnsqzeeccNtMEXwrPTdDmnVmvqcPVsdOIhhohEoyF0o5oXCM2VlnUbj6GENUwTPSt/t2MTArD9bzjhwMOqbBhdoeBlNWmP1TR/wSR70Lz4LZSYygMnd5d+vyj0/J/0OfNQaab8bP4oh5xOgQRo2e7iCM9EfA+iUmbLYxU9PvP+QGb0VVQj39JccOIIVKD+ssEx21CkrVoMUNNyRzkZGani6P7Qaun1FtpieePeWb3jRnwSMTYtTHSU/ioE+w7bCDuHyy4IfUyu73XjPw211OqVSsA41mjjIh/w+Y/jgaDyUAEygeqitUdDFKlVHbu4PSUnnIyJuc0sT0sEKChS4ZKzBSlI2ttYpzynXISkNin3I7zNYRyQaDyUAE1CI1loF///t/5iGV7ChEqystMIKp6b+vHPnde6P52iHRUYtiTwGewZuFIourbZt1F84emhwv8F6gZWiomNZWb3IVAgXp8TQwh6hA4awMiHhYnp6n0DQJxafAlXcjq3gsD00vGjDs48IyM8/DqABN3BHfDybzUbo+/b96KHhZTXoeVXVITCEghFPPVIWoiElpR9UcTtkBuHloeGVax4aPDR4mocGDw2e5qHhlWz/BchZWz/GCLenAAAAAElFTkSuQmCC"


          <Image src={ImageBase64} />

@supermaverickws
Copy link
Author

@zhiqingchen 外面嵌套层 Form 试试?我嵌套Form 就不能了
<Form><Image src={ImageBase64} /></Form>

@zhiqingchen
Copy link
Member

@zhiqingchen 外面嵌套层 Form 试试?我嵌套Form 就不能了 <Form><Image src={ImageBase64} /></Form>

那是 Form 组件的问题,后续修复

@supermaverickws
Copy link
Author

@zhiqingchen
rn 的 Form 下 会调用 deppDiveIntoChildren 方法里的 React.cloneElement(child, { ...child.props }, this.deppDiveIntoChildren(child.props.children))
而 React.cloneElement 方法第三个参数是 children.
第三参数最终调用的 React.Children.toArray(children) 传入null 的话会返回空 的 数据对象
image

image

image

@supermaverickws
Copy link
Author

@zhiqingchen 好的。修复完毕的话。你可以关闭此提问。谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request T-rn Target - 编译到 React Native
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants