1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | 'use strict';
|
13 |
|
14 | var _require = require('./ReactFiberRoot'),
|
15 | createFiberRoot = _require.createFiberRoot;
|
16 |
|
17 | var ReactFiberScheduler = require('./ReactFiberScheduler');
|
18 |
|
19 | module.exports = function (config) {
|
20 | var _ReactFiberScheduler = ReactFiberScheduler(config),
|
21 | scheduleWork = _ReactFiberScheduler.scheduleWork,
|
22 | performWithPriority = _ReactFiberScheduler.performWithPriority;
|
23 |
|
24 | return {
|
25 | mountContainer: function (element, containerInfo) {
|
26 | var root = createFiberRoot(containerInfo);
|
27 | var container = root.current;
|
28 |
|
29 |
|
30 |
|
31 | container.pendingProps = element;
|
32 |
|
33 | scheduleWork(root);
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | return container;
|
39 | },
|
40 | updateContainer: function (element, container) {
|
41 |
|
42 | var root = container.stateNode;
|
43 |
|
44 | root.current.pendingProps = element;
|
45 |
|
46 | scheduleWork(root);
|
47 | },
|
48 | unmountContainer: function (container) {
|
49 |
|
50 | var root = container.stateNode;
|
51 |
|
52 | root.current.pendingProps = [];
|
53 |
|
54 | scheduleWork(root);
|
55 | },
|
56 |
|
57 |
|
58 | performWithPriority: performWithPriority,
|
59 |
|
60 | getPublicRootInstance: function (container) {
|
61 | return null;
|
62 | }
|
63 | };
|
64 | }; |
\ | No newline at end of file |