Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit b772384

Browse files
authored
Merge pull request #53 from bradleyayers/patch-4
Update README on how React and ReactDOM are found
2 parents a147158 + 4361ed1 commit b772384

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,15 @@ class MyComponent extends Component {
100100
101101
### Injecting React and ReactDOM
102102
103-
By default, the React integration will look for `React` and `ReactDOM` on the window. However, this isn't the case for all apps. If you're using ES2015 modules or CommonJS, you'll have to inject them into the reactify function as options:
103+
By default, the React integration will import `React` and `ReactDOM` via `peerDependencies`. However, you can override this by passing your own versions:
104104
105105
```js
106106
import reactify from 'skatejs-react-integration';
107-
import React from 'react';
108-
import ReactDOM from 'react-dom';
107+
import React from 'my-custom-react';
108+
import ReactDOM from 'my-custom-react-dom';
109109

110-
export default reactify(..., {
111-
React,
112-
ReactDOM
113-
});
110+
class WebComponent extends HTMLElement {}
111+
const ReactComponent = reactify(WebComponent, { React, ReactDOM });
114112
```
115113
116114
### Multiple React versions

0 commit comments

Comments
 (0)