File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -96,21 +96,19 @@ class Popover extends React.Component {
9696 this . targetEl = ReactDOM . findDOMNode ( this )
9797 if ( this . props . isOpen ) this . enter ( )
9898 }
99- componentWillReceiveProps ( propsNext ) {
100- //log(`Component received props!`, propsNext)
101- const willOpen = ! this . props . isOpen && propsNext . isOpen
102- const willClose = this . props . isOpen && ! propsNext . isOpen
103-
104- if ( willOpen ) this . open ( )
105- else if ( willClose ) this . close ( )
106- }
10799 componentDidUpdate ( propsPrev , statePrev ) {
108100 //log(`Component did update!`)
109101 const didOpen = ! statePrev . toggle && this . state . toggle
110102 const didClose = statePrev . toggle && ! this . state . toggle
111103
112- if ( didOpen ) this . enter ( )
113- else if ( didClose ) this . exit ( )
104+ if ( didOpen ) {
105+ this . open ( ) // todo: remove
106+ this . enter ( )
107+ }
108+ else if ( didClose ) {
109+ this . close ( ) // todo: remove
110+ this . exit ( )
111+ }
114112 }
115113 componentWillUnmount ( ) {
116114 /* If the Popover is unmounted while animating,
You can’t perform that action at this time.
0 commit comments