Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DropdownHolder Example #1
export class App extends React.Component {
render() {
return (
<View style={{width: '100%', height: '100%'}}>
<Nav/>
<DropdownAlert ref={(ref) => DropDownHolder.setDropDown(ref)}/>
</View>
)
}
}
// ...
export class DropDownHolder {
static dropDown;
static setDropDown(dropDown) {
this.dropDown = dropDown;
}
static getDropDown() {
return this.dropDown;
}
}
@JayGajjar

This comment has been minimized.

Copy link

@JayGajjar JayGajjar commented Sep 15, 2019

Usage :

DropDownHolder.dropDown.alertWithType('error', 'Error', 'Error message');

@AhmadJawabra

This comment has been minimized.

Copy link

@AhmadJawabra AhmadJawabra commented Jan 8, 2020

be sure to create separate component that contain DropDownHolder to write clean code

@cyb3rsalih

This comment has been minimized.

Copy link

@cyb3rsalih cyb3rsalih commented Aug 31, 2020

should we have a connect()(Screen) like linker for screens also, like redux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment