Created
November 26, 2018 01:15
-
-
Save vincentriemer/1c761d9d31d85e9077cf82546ef62f5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from "react-dom"; | |
export default ReactDOM.unstable_batchedUpdates; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For RN, export a function with the same signature but doesn't do anything special | |
export default f => f(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Web will resolve batchedUpdates.js and RN will resolve batchedUpdates.native.js | |
import batchedUpdates from "./batchedUpdates"; | |
batchedUpdates(() => { | |
setState({}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment