-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Hidden does not render multiple children regardless of breakpoints #8072
Comments
I expect I also expect that it hides all children. @oliviertassinari is there a reason why a flow type restriction exists to a single child? I would expect the type to be |
@rosskevin No reason I can remember. I was fighting with flow to get a green build. |
@Izhaki I just submitted a PR to fix the flow type.
I assume it is there to prevent Here is the implementation: /**
* Verifies the object is a ReactElement.
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}; Now, the title of your issue is So, with all of that said (and children type fixed), I don't think I understand the issue you have. Can you explain? |
@rosskevin Sorry, the title was indeed confusing; I've updated it. Essentially, if there's more than one child, |
…8082) * [Hidden] change children type and add children tests * Fixes #8072 * use untilSelector for browser tests * Use strictEqual and ensure no additional unsupported props are passed * Add back ref check and switch message to keys only to avoid mismatch of message and code checks to debug CI error. * remove ref, we don’t apply it. * ok, add back ref? * codecov hanging, trigger another build * lint
When
Hidden
is provided with more than one child (at least in thecss
implementation), it does not throw an error and simply hides the content altogether.This is probably due to this check:
which I assume returns
false
being given more than one element.Before looking deeper into this, I'm not sure if this is actually the desired behaviour:
May submit a PR.
The text was updated successfully, but these errors were encountered: