@@ -441,6 +441,79 @@ exports.examples = [
441441 return < ZIndexExample /> ;
442442 } ,
443443 } ,
444+ {
445+ title : '`display: none` style' ,
446+ render ( ) : React . Node {
447+ type Props = $ReadOnly < { || } > ;
448+ type State = { |
449+ index : number ,
450+ | } ;
451+
452+ class DisplayNoneStyle extends React . Component < Props , State > {
453+ state = {
454+ index : 0 ,
455+ } ;
456+
457+ render ( ) {
458+ return (
459+ < TouchableWithoutFeedback onPress = { this . _handlePress } >
460+ < View >
461+ < Text style = { { paddingBottom : 10 } } >
462+ Press to toggle `display: none`
463+ </ Text >
464+ < View
465+ style = { {
466+ height : 50 ,
467+ width : 50 ,
468+ backgroundColor : 'red' ,
469+ display : this . state . index % 2 === 0 ? 'none' : 'flex' ,
470+ } }
471+ />
472+ < View
473+ style = { {
474+ height : 50 ,
475+ width : 50 ,
476+ backgroundColor : 'blue' ,
477+ display : this . state . index % 3 === 0 ? 'none' : 'flex' ,
478+ } }
479+ />
480+ < View
481+ style = { {
482+ height : 50 ,
483+ width : 50 ,
484+ backgroundColor : 'yellow' ,
485+ display : this . state . index % 5 === 0 ? 'none' : 'flex' ,
486+ } } >
487+ < View
488+ style = { {
489+ height : 30 ,
490+ width : 30 ,
491+ backgroundColor : 'salmon' ,
492+ display : this . state . index % 11 === 0 ? 'none' : 'flex' ,
493+ } }
494+ />
495+ </ View >
496+ < View
497+ style = { {
498+ height : 50 ,
499+ width : 50 ,
500+ backgroundColor : 'magenta' ,
501+ display : this . state . index % 7 === 0 ? 'none' : 'flex' ,
502+ } }
503+ />
504+ </ View >
505+ </ TouchableWithoutFeedback >
506+ ) ;
507+ }
508+
509+ _handlePress = ( ) => {
510+ this . setState ( { index : this . state . index + 1 } ) ;
511+ } ;
512+ }
513+
514+ return < DisplayNoneStyle / > ;
515+ } ,
516+ } ,
444517 {
445518 title : 'BackfaceVisibility' ,
446519 render : function ( ) : React . Node {
0 commit comments