Ich versuche derzeit, den Status meiner Komponenten über eine untergeordnete Komponente zu aktualisieren, aber die Callback-Funktion teilt mir mit, dass der Status nicht aktualisiert wurde.
Methode (loadModuleContent)Reagieren Aktualisierungszustand seltsames Verhalten
export default class LayoutPage extends React.Component {
constructor() {
super();
this.startSession = this.startSession.bind(this);
this.loadModuleContent = this.loadModuleContent.bind(this);
this.state = {
content: undefined,
group: undefined,
title: undefined,
selectionIndex: undefined
}
}
static navigationOptions = {
header: null
};
loadModuleContent(_content, _title, _selectedIndex) {
console.log("Inserting index: " + _selectedIndex);
this.setState({
content: _content,
title: _title,
selectionIndex: _selectedIndex
}, console.log("State updated:" + this.state.selectionIndex));
}
...
fühle mich so dumm .... danke –