-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1e205d
commit 4942b7b
Showing
1 changed file
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
So you're a [Preact](https://preactjs.com/) user, but want to use some React libraries with it. You wanted to [set up aliases or something](https://preactjs.com/guide/switching-to-preact#easy-preact-compat-alias), but can't do it for some reason. The solution is simple, though: | ||
So you're a [Preact](https://preactjs.com/) user, but want to use some React libraries with it. You wanted to [set up aliases or something](https://preactjs.com/guide/v10/getting-started#aliasing-react-to-preact), but can't do it for some reason. | ||
|
||
``` | ||
yarn add preact preact-compat | ||
yarn add preact-compat/react preact-compat/react-dom | ||
The `preact-compat/react` and `preact-compat/react-dom` alias repositories are here for you! | ||
Install them as you would any other npm module, and these aliases will be used from Github: | ||
|
||
```sh | ||
# Preact 10+ | ||
npm i -S preact-compat/react#1.x preact-compat/react-dom#1.x | ||
# Older Preact versions | ||
npm i -S preact-compat/react#0.x preact-compat/react-dom#0.x | ||
``` | ||
|
||
Or if you're not a fan of [yarn](http://yarnpkg.com/): | ||
... or for Yarn users: | ||
|
||
``` | ||
npm i -S preact preact-compat | ||
npm i -S preact-compat/react preact-compat/react-dom | ||
```sh | ||
# Preact 10+ | ||
yarn add preact-compat/react#1.x preact-compat/react-dom#1.x | ||
# Older Preact versions | ||
yarn add preact-compat/react#0.x preact-compat/react-dom#0.x | ||
``` |
4942b7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(closes #4 actually)