🚧 Work in Progress 🚧
React ❤️ Mini Program
Write React code, run on Mini Programs.
Support these platforms:
- Baidu
- Alipay
- Toutiao
- Kuai App ( TBD )
- Web ( TBD )
Use
TARGET=alipay
beforeyarn start
to test different platforms.
import React, { useState } from 'react'
import { View, Text, Button, render } from 'fard' // will rename later
import './index.styl'
const App = () => {
const [count, setCount] = useState(0)
return (
<View>
<Text>{count}</Text>
<Button onClick={() => setCount(count + 1)}>+</Button>
</View>
)
}
render(App)
For more details see packages/demo-webpack.
Goji is inspired from fard and remax.
This picture show the architecture of fard.
And here is an article about fard: fard:fre 转小程序的新思路
Since fard
use monorepo managed by lerna you should install lerna
at first.
npm i -g lerna
Then install all dependencies:
lerna bootstrap
For more details of how to use Lerna see the official documents.
For example run these commands if you'd like to run fard-demo with Webpack:
cd packages/demo-webpack
yarn build