mobx-react icon indicating copy to clipboard operation
mobx-react copied to clipboard

Updating component state from store

Open jwhscholten opened this issue 9 years ago • 2 comments

Why isn't my components EditMode updating with this layout and how to properly implement this?

	render() {
		return (
			<View>
			<SortableSudokuGrid
				ref={component => (this._sortableSudokuGrid = component)}
				containerStyle={{ backgroundColor: "#fff" }}
				columnCount={this.state.columnCount}
				dataSource={this.props.data}
				renderCell={this._renderGridCell}
				sortable={this.state.sortable}
			/>
			<Text>{this.props.EditMode.isEditing}</Text>
			</View>
		);
	}

This works:

	render() {
		return (
			<Text>{this.props.EditMode.isEditing}</Text>
		);
	}

jwhscholten avatar Jun 30 '17 18:06 jwhscholten

Please try to create a minimal test case.

On Fri, Jun 30, 2017 at 1:16 PM, jwhscholten [email protected] wrote:

Why isn't my components EditMode updating with this layout and how to properly implement this?

render() { return ( <SortableSudokuGrid ref={component => (this._sortableSudokuGrid = component)} containerStyle={{ backgroundColor: "#fff" }} columnCount={this.state.columnCount} dataSource={this.props.data} renderCell={this._renderGridCell} sortable={this.state.sortable} /> {this.props.EditMode.isEditing} ); }

This works:

render() { return ( {this.props.EditMode.isEditing} ); }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx-react/issues/289, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIrco2yINeeos74D0YmAzdTLVYyUT77ks5sJTuZgaJpZM4OK5ij .

-- -Matt Ruby- [email protected]

mattruby avatar Jun 30 '17 18:06 mattruby

Sorry, please ignore this (non) issue.

jwhscholten avatar Jul 01 '17 12:07 jwhscholten