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

Error in Image component with css attribute (react-native-web) #10

Open
made-aryadinata opened this issue Feb 7, 2018 · 1 comment
Open

Comments

@made-aryadinata
Copy link

Please correct me if I am wrong - Uranium works by adding <style> child in a component with css attribute.
However, since [email protected] and [email protected], <Image> with nested component is not supported. This is the error:

The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.

References:

@awidiyadew
Copy link

@made-aryadinata I have same issue, if Image component has children then we shoud use ImageBackground, but if your Image component not contain any child and still have error message

....Image component cannot contain children

In my case I solve the issue by replace css props with style props and keep using Image component. Because the css props just adding nested <style> in the image component... so we can replace css props if only if we are not using @media query in the image component styling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants