Semantic-UI-React icon indicating copy to clipboard operation
Semantic-UI-React copied to clipboard

fix(Item): actually make `content` a shorthand prop for `ItemContent`

Open noinkling opened this issue 5 years ago • 1 comments

It says it is in the docs, but actually Item currently just forwards the content prop to ItemContent like a typical content prop. This PR will allow use of as, className and verticalAlign via shorthand, and is especially useful when providing the items array shorthand to ItemGroup.

With this PR nothing changes for people who were using a primitive value, but it might be a breaking change if people were supplying an element or array, they would need to change it to content={ content: <element /> } or similar to match previous behaviour.

Also with this change ItemContent will no longer unconditionally render, at least one of the shorthands has to be present.

noinkling avatar Nov 23 '20 05:11 noinkling

Codecov Report

Merging #4118 (a8a317c) into master (c828368) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4118   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         180      180           
  Lines        3241     3246    +5     
=======================================
+ Hits         3233     3238    +5     
  Misses          8        8           
Impacted Files Coverage Δ
src/views/Item/Item.js 100.00% <100.00%> (ø)
src/views/Item/ItemContent.js 100.00% <100.00%> (ø)

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 c828368...a8a317c. Read the comment docs.

codecov-io avatar Nov 23 '20 05:11 codecov-io