MCPcopy
hub / github.com/mobxjs/mobx / changeStuff

Function changeStuff

packages/mobx-react/__tests__/issue21.test.tsx:182–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180 const Wrapper = () => <Parent />
181
182 function changeStuff() {
183 act(() => {
184 transaction(() => {
185 data.items[0].label = "hello" // schedules state change for Child
186 data.items[0] = createItem(2, "test") // Child should still receive new prop!
187 })
188
189 // @ts-ignore
190 this.setState({}) // trigger update
191 })
192 }
193
194 const { container } = render(<Wrapper />)
195 expect(events.sort()).toEqual(

Callers

nothing calls this directly

Calls 2

transactionFunction · 0.90
createItemFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…