https://github.com/csbun/rax-compat
React compatibility layer for Rax.
https://github.com/csbun/rax-compat
Last synced: about 2 months ago
JSON representation
React compatibility layer for Rax.
- Host: GitHub
- URL: https://github.com/csbun/rax-compat
- Owner: csbun
- Created: 2017-04-10T11:45:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T11:50:33.000Z (about 8 years ago)
- Last Synced: 2025-01-07T23:22:38.069Z (4 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rax-compat
This module makes React-based modules work with [Rax](https://alibaba.github.io/rax/)(web), without any code changes.
## Installation
You need to install rax-compat first through npm:
```
npm i -S rax-compat
```And have Rax already installed. If you don't, install it like:
```
npm i -S rax
```Or with yarn:
```
yarn add rax-compat rax
```## Usage with Webpack
Add an alias for react and react-dom:
```javascript
{
resolve: {
alias: {
'react': 'rax-compat',
'react-dom': 'rax-compat',
}
},
}
```If you are using [babel-preset-rax](https://www.npmjs.com/package/babel-preset-rax), you should overwrite plugin [babel-plugin-transform-react-jsx](https://www.npmjs.com/package/babel-plugin-transform-react-jsx) in _.babelrc_ (or babel-loader in _webpack.config.js_) with default config.
```json
{
"plugins": [ "transform-react-jsx" ]
}
```