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

Update README on how React and ReactDOM are found #53

Merged
merged 1 commit into from
Sep 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,15 @@ If your web component renders content to itself, make sure you're using Shadow D

### Injecting React and ReactDOM

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:
By default, the React integration will import `React` and `ReactDOM` via `peerDependencies`. However, you can override this by passing your own versions:

```js
import reactify from 'skatejs-react-integration';
import React from 'react';
import ReactDOM from 'react-dom';
import React from 'my-custom-react';
import ReactDOM from 'my-custom-react-dom';

export default reactify(..., {
React,
ReactDOM
});
class WebComponent extends HTMLElement {}
const ReactComponent = reactify(WebComponent, { React, ReactDOM });
```

### Multiple React versions
Expand Down