Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
const { realm } = this.props;
// Register an action to create a project
Actions.refresh({
rightTitle: " Create",
onRight: () => {
this.toggleModal();
}
});
// Get a result containing all projects
const projects = realm
.objects("Project")
.filtered("owner == $0", this.props.user.identity)
.sorted("timestamp", true);
// When the list of projects change, React won't know about it because the Result object itself did not change.
projects.addListener(() => {
// Bump a data version counter that we'll pass to components that should update when the projects change.
this.setState({ dataVersion: this.state.dataVersion + 1 });
github = HTMLHelper.v2SocialElement2Object(getSocialElement('GitHub'));
twitter = HTMLHelper.v2SocialElement2Object(getSocialElement('Twitter'));
dribbble = HTMLHelper.v2SocialElement2Object(getSocialElement('Dribbble'));
instagram = HTMLHelper.v2SocialElement2Object(getSocialElement('Instagram'));
console.log({
username, signature, company, position,
avatarURI, num, regDate, liveness,
github, twitter, dribbble, instagram,
});
this.setState({
username, signature, company, position,
avatarURI, num, regDate, liveness,
github, twitter, dribbble, instagram,
});
Actions.refresh({ title: username });
});
}
.then((res) => {
if (res && res.result) {
this.setState({
dataDetail: res.data
});
Actions.refresh({titleData: res.data});
repositoryActions.addRepositoryLocalRead(this.props.ownerName, this.props.repositoryName, res.data);
}
});
this._refresh();
_renderTitle = title => {
Actions.refresh({
renderTitle: (
)
})
}
const selectLanguage = (lang, langName) => {
AsyncStorage.setItem(Constant.LANGUAGE_SELECT, lang);
AsyncStorage.setItem(Constant.LANGUAGE_SELECT_NAME, langName);
changeLocale(lang);
Actions.refresh();
};
const openDrawer = () => {
NavigationActions.refresh({
key: 'drawer',
open: true
})
}
setUpNavigationBar = () => {
Actions.refresh({
rightTitle: '发布',
onRight: this.onRightButtonPress,
rightButtonTextStyle: { color: 'white' },
});
};
this.setState(prevState => ({ hideTabBar: !prevState.hideTabBar }), () => {
Actions.refresh({
hideTabBar: this.state.hideTabBar,
}, 'tab_2');
});
};
}, () => Actions.refresh({title: parsed.length}));
}