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(Portal): throw an error if React.Fragment passed as trigger #3998

Merged
merged 2 commits into from
Jul 27, 2020

Conversation

layershifter
Copy link
Member

Fixes #3928.

Now we will throw errors in two additional cases:

  • when an array of elements is passed, <Popup trigger={[<b />, <b />]} />
  • when a React.Fragment is passed <Popup trigger={[<><b /></>} /> as it impossible to use React.cloneElement() with it to assign props

This change is not a breaking as previously these scenarios were impossible, so this PR just adds only meaningful errors.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2020

Codecov Report

Merging #3998 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3998   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files         183      184    +1     
  Lines        3157     3164    +7     
=======================================
+ Hits         3152     3159    +7     
  Misses          5        5           
Impacted Files Coverage Δ
src/addons/Portal/Portal.js 100.00% <100.00%> (ø)
src/addons/Portal/utils/validateTrigger.js 100.00% <100.00%> (ø)
src/modules/Popup/Popup.js 98.73% <100.00%> (+0.01%) ⬆️

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 7889c7a...acad806. Read the comment docs.

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

Successfully merging this pull request may close these issues.

Popup: is not rendered when trigger is React.Fragment
2 participants