Not a perfect solution.
I wasn't able to make the ReactDOM.render part work, but using hooks seems to do the job of re-rendering my components fine.
Step 1
Remove the RectDOM.render from index.js and replace with standard expo:
import { registerRootComponent } from 'expo';
import App from './App';
registerRootComponent(App);
Step 2
Surround you App() content with Provider (don't forget to import Provider and store):
import store from './app/store';
import { Provider } from "react-redux";
function App () {
return (
<Provider store={store}>
<Components/>
</Provider>
)
}
Step 3
In the component you want to reload when a change occurs in redux memory create an instance of your object:
const currentTicket = useSelector((state) =>
state.tickets.find((ticket) => ticket.id == global.currentTicketID)
);
Note: My redux store is an array of ticket objects so I must find the ticket I want to work with using the array find function
And then create a hook that takes in a value of your instance:
useEffect(() => {
//code you want to run on change of the instance value
}, [currentTicket.num]);
Note: this only works if you have functional components (not classes)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…