@@ -149,7 +149,7 @@ export class Picker extends React.Component<PropType, StateType> {
149149
150150 this . eventsHandlers = { } ;
151151
152- if ( openPaths === null ) {
152+ if ( ! openPaths ) {
153153 // Uncontrolled mode
154154 state . isOpenControlled = false ;
155155 state . openPaths = [ ] ;
@@ -171,7 +171,7 @@ export class Picker extends React.Component<PropType, StateType> {
171171 }
172172 }
173173
174- if ( selectedPaths === null ) {
174+ if ( ! selectedPaths ) {
175175 // Uncontrolled mode
176176 state . isSelectControlled = false ;
177177 state . selectedPaths = defaultSelectedPaths ? clone ( defaultSelectedPaths ) : [ ] ;
@@ -205,7 +205,7 @@ export class Picker extends React.Component<PropType, StateType> {
205205 }
206206
207207 static getDerivedStateFromProps ( nextProps : PropType , prevState : StateType ) {
208- if ( ( prevState . isOpenControlled !== ( nextProps . openPaths !== null ) ) || ( prevState . isSelectControlled !== ( nextProps . selectedPaths !== null ) ) ) {
208+ if ( ( prevState . isOpenControlled !== Boolean ( nextProps . openPaths ) ) || ( prevState . isSelectControlled !== Boolean ( nextProps . selectedPaths ) ) ) {
209209 console . warn ( 'Cannot change between controlled/uncontrolled modes' ) ;
210210 }
211211
@@ -346,7 +346,7 @@ export class Picker extends React.Component<PropType, StateType> {
346346
347347 render ( ) {
348348 const selectedPaths = this . state . selectedPaths ? this . state . selectedPaths : this . props . selectedPaths ;
349- let openPaths = this . state . openPaths ? this . state . openPaths : this . props . openPaths ;
349+ let openPaths = this . state . openPaths || this . props . openPaths || this . props . defaultOpenPaths ;
350350 const { setRefetch} = this . props ;
351351
352352 openPaths = clone ( openPaths ) ;
0 commit comments