Skip to content

Commit 6001acb

Browse files
gaearonfacebook-github-bot
authored andcommitted
Declare a dependency on scheduler (#24802)
Summary: ReactNativeRenderer has `require('scheduler')` in it but we don't seem to declare a dependency. As a result, the latest sync broke `useEffect` in open source master: ```js function Counter() { const [count, setCount] = useState(0); useEffect(() => { const id = setInterval(() => { setCount(c => c + 1); }, 1000) return () => clearInterval(id); }, []) return <View><Text>{count}</Text></View> } ``` <img width="535" alt="Screen Shot 2019-05-10 at 3 26 05 PM" src="https://user-images.githubusercontent.com/810438/57535832-e04dc000-733a-11e9-8e3e-d685171ec55a.png"> This adds an explicit dependency on the same version we're currently using internally. <img width="535" alt="Screen Shot 2019-05-10 at 3 47 42 PM" src="https://user-images.githubusercontent.com/810438/57535886-f65b8080-733a-11e9-82c3-78e6c3a3888b.png"> Pull Request resolved: #24802 Differential Revision: D15295252 Pulled By: hramos fbshipit-source-id: cd897ac590de1b719f28234f7631b0dcc069d043
1 parent 310cc38 commit 6001acb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"prettier": "1.17.0",
135135
"react": "16.8.6",
136136
"react-test-renderer": "16.8.6",
137+
"scheduler": "0.14.0",
137138
"shelljs": "^0.7.8",
138139
"ws": "^6.1.4",
139140
"yargs": "^9.0.0"

yarn.lock

+8
Original file line numberDiff line numberDiff line change
@@ -6480,6 +6480,14 @@ sax@~1.1.1:
64806480
resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240"
64816481
integrity sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA=
64826482

6483+
6484+
version "0.14.0"
6485+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.14.0.tgz#b392c23c9c14bfa2933d4740ad5603cc0d59ea5b"
6486+
integrity sha512-9CgbS06Kki2f4R9FjLSITjZo5BZxPsryiRNyL3LpvrM9WxcVmhlqAOc9E+KQbeI2nqej4JIIbOsfdL51cNb4Iw==
6487+
dependencies:
6488+
loose-envify "^1.1.0"
6489+
object-assign "^4.1.1"
6490+
64836491
scheduler@^0.13.6:
64846492
version "0.13.6"
64856493
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"

0 commit comments

Comments
 (0)