Releases: gaearon/react-proxy
Releases · gaearon/react-proxy
v2.0.2
v1.1.3
v2.0.1
v1.1.2
v2.0.0
Breaking Changes
React 0.14 is now required
We assume that your code doesn't have warnings on React 0.14.
For example, we won't handle ES6 classes that don't inherit from React.Component
correctly.
createProxy()
is now the default export
Before
import { createProxy } from 'react-proxy';
After
import createProxy from 'react-proxy';
getForceUpdate()
is gone
Bye bye getForceUpdate()
. We don't offer it anymore.
You should use react-deep-force-update directly now.
Before
import React from 'react';
import { getForceUpdate } from 'react-proxy';
const deepForceUpdate = getForceUpdate(React);
After
import deepForceUpdate from 'react-deep-force-update';
Proxy#update()
no longer returns mounted instances
Now that’s a bummer! We know. Sadly there’s no way we can retrieve a list of mounted instances for the pure function components. For consistency, we don’t attempt to do this at all now. You are encourage to keep a reference to the root instance yourself, and use react-deep-force-update to update it when necessary. Hopefully we’ll resolve this eventually when React provides a first-class DevTools API for traversing the rendered tree.
Before
import { createProxy, getForceUpdate } from 'react-proxy';
const proxy = createProxy(ComponentVersion1);
const Proxy = proxy.get();
React.render(<Proxy />, rootEl);
const mountedInstances = proxy.update(ComponentVersion2);
const forceUpdate = getForceUpdate(React);
mountedInstances.forEach(forceUpdate);
After
import React from 'react';
import { render } from 'react-dom';
import createProxy from 'react-proxy';
import deepForceUpdate from 'react-deep-force-update';
const proxy = createProxy(ComponentVersion1);
const Proxy = proxy.get();
// You now have to keep a reference to the root instance.
const rootInstance = render(<Proxy />, rootEl);
proxy.update(ComponentVersion2);
deepForceUpdate(rootInstance);
Improvements
- Adds support for React 0.14 pure function components