Conversation
| import * as React from 'react'; | ||
| import * as Adapter from 'enzyme-adapter-react-16'; | ||
| import * as Enzyme from 'enzyme'; |
There was a problem hiding this comment.
Consider turning on esModuleInterop?
2062fa5 to
be77893
Compare
| </p> | ||
| </details> | ||
|
|
||
| <details> |
There was a problem hiding this comment.
FYI: GitHub's "Display the rich diff" will help.
Fixes cyclejs#8 Implementation of `jsxFactory` is just a copy and paste from @sliptype's pull request (cyclejs/react-dom#3). Test cases have been rewritten in a DOM-free way (using enzyme).
| ```js | ||
| plugins: [ | ||
| new webpack.ProvidePlugin({ | ||
| jsxFactory: ['@cycle/react', 'jsxFactory'] |
There was a problem hiding this comment.
This line was originally
jsxFactory: ['react-dom', 'jsxFactory']But I believe 'react-dom' was a mistake for '@cycle/react-dom', so now it is '@cycle/react'.
| @@ -0,0 +1,36 @@ | |||
| import {createElement, ReactElement, ReactType} from 'react'; | |||
There was a problem hiding this comment.
This file is a copy and paste of https://github.com/cyclejs/react-dom/blob/229e592ab80998ace5bf4fd0c12eee36f4499731/src/jsx-factory.ts, except for import path of incorporate funciton.
The original filename was kebab case (jsx-factory.tsx), but I've renamed to camel case, following the naming convention of this repository.
| @@ -0,0 +1,83 @@ | |||
| import * as React from 'react'; | |||
There was a problem hiding this comment.
Test cases have been almost rewritten in a DOM-free way (using enzyme's shallow rendering).
The next one, however, was difficult to rewrite with my limited knowledge.
Any good ideas?
| "jsx": "react", | ||
| "jsxFactory": "jsxFactory.createElement" |
There was a problem hiding this comment.
What do you think of configuring jsx and jsxFactory here?
Or should we separately have test/tsconfig.json instead?
Fixes #8
Implementation of
jsxFactoryis just a copy and paste from @sliptype'spull request (cyclejs/react-dom#3).
Test cases have been rewritten in a DOM-free way (using enzyme).
There are still some points that I'm not sure, so I'll leave this to be a draft.
I'll add some inline comments.