Only: Support "visible" modifier
See original GitHub issueWhat:
I propose to support the visible
prop on the Only
component.
When provided, this prop would tell the Only
component to render but hide its children, instead of conditionally rendering them.
Why:
This would allow more control over the rendering behavior, and would solve potential nodes mismatch issues during SSR (#117).
How:
It’s tricky, since I feel that adding this prop to the current component may complicate it too much. Introducing a separate component, or splitting them into different component. Needs discussion.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Visibility modifiers | Kotlin Documentation
The internal visibility modifier means that the member is visible within the same module. More specifically, a module is a set of Kotlin...
Read more >Kotlin Visibility Modifiers - public, protected, internal, private
Visibility Modifiers are modifiers that when appended to a class/interface/property/function in Kotlin, would define where all it is visible and ...
Read more >TypeScript Data Modifiers: public, private, protected, static ...
The private access modifier ensures that class members are visible only to that class and are not accessible outside the containing class. Example:...
Read more >Visibility Modifiers in Kotlin - Baeldung
Visibility modifiers are used to determine what other elements of code have access to the element being modified. They apply to some different ......
Read more >Kotlin basics: visibility modifiers. public, internal , protected ...
The public modifiers means that the declarations are visible everywhere. In Kotlin the default visibility modifier is public while in Java is package-private....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Personally I wouldn’t mind the jump, as it happens when the viewport width changes so you would expect the layout to change. It wouldn’t jump by itself like an image that took a while to load in or an annoying advert 👻
I use the
display: none
technique when making my own responsive layouts so that’s why I would go for it 😃Perhaps you could add a prop for it?
Where
hide
uses visiblity none, andremove
uses display none? The default beingremove
?@bitttttten, worry not! Your involvement is highly appreciated, and I’ve started with the implementation that will be a part of #250 (next minor release).
display:none
is viable, if you don’t mind the jump. Ideally, it would be nice to specify which of the two behaviors you want: visually hidden, but taking space, or entirely not visible. Since both options concern CSS, it’s quite possible to make the property/value pair parametrized through<Visible>
component’s props.