Skip to content

Commit

Permalink
Fix the fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Nov 22, 2020
1 parent 6ce6287 commit 94543c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions fixtures/flight/server/handler.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import {pipeToNodeWritable} from 'react-transport-dom-webpack/server';
import * as React from 'react';
import {CacheContext, createCache} from 'react/unstable-cache.js';

import url from 'url';

Expand All @@ -11,8 +10,6 @@ function resolve(path) {
}

module.exports = async function(req, res) {
CacheContext._currentValue = createCache();

res.setHeader('Access-Control-Allow-Origin', '*');
const m = await import('../src/App.server.js');
// const m = require('../src/App.server.js');
Expand Down
11 changes: 3 additions & 8 deletions fixtures/flight/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import {Suspense} from 'react';
import ReactDOM from 'react-dom';
import ReactTransportDOMClient from 'react-transport-dom-webpack';
import {CacheContext, createCache} from 'react/unstable-cache';

let data = ReactTransportDOMClient.createFromFetch(
fetch('http://localhost:3001')
Expand All @@ -12,14 +11,10 @@ function Content() {
return data.readRoot();
}

let cache = createCache();

ReactDOM.render(
<CacheContext.Provider value={cache}>
<Suspense fallback={<h1>Loading...</h1>}>
<Content />
</Suspense>
</CacheContext.Provider>,
<Suspense fallback={<h1>Loading...</h1>}>
<Content />
</Suspense>,
document.getElementById('root')
);

Expand Down

0 comments on commit 94543c8

Please sign in to comment.