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