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

bugfix: extra style prop for image children container #2933

Merged

Conversation

maxikgreat
Copy link
Contributor

@maxikgreat maxikgreat commented Mar 30, 2021

Motivation and solution

I solve the problem of opened issue #2581. There are no breaking changes of project and even of component 😄
Just I've added an extra style property for Image to avoid collision between children and image styles.

Btw, I didn't expect to see an extra wrapper for children (it's redundant from my perspective) but anyway I solve the problem based on already existing functionality and expectations of constant users.

Did you add tests for your changes?

I've extended one test case to ensure props pass correctly.

If relevant, did you update the documentation?

Yep.

* added extra style property for children container
@maxikgreat maxikgreat changed the title Image component bugfix: extra style prop for image children container Mar 30, 2021
@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #2933 (cd226d4) into next (d78718c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head cd226d4 differs from pull request most recent head 51d217e. Consider uploading reports for the commit 51d217e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             next    #2933      +/-   ##
==========================================
+ Coverage   88.20%   88.21%   +0.01%     
==========================================
  Files          50       50              
  Lines        1009     1010       +1     
  Branches      399      400       +1     
==========================================
+ Hits          890      891       +1     
  Misses         76       76              
  Partials       43       43              
Impacted Files Coverage Δ
src/image/Image.tsx 76.92% <100.00%> (+0.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d78718c...51d217e. Read the comment docs.

@vinceniko
Copy link

I think this change broke my images after I updated to 3.4.0. The images do not get rendered anymore. The React Native Image component still works however. Below is the relevant Elements' Image Component.

<Image
  source={{ uri: uri }}
  style={{
    width: "100%",
    height: width * imageScale * (mediaDims.height / mediaDims.width),
  }}
/>

@arpitBhalla
Copy link
Member

Hey @vinceniko Can you please create new issue, with the information of problem that you are facing

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