airbnb / goji-js

React ❤️ Mini Program
https://goji.js.org
MIT License
224 stars 27 forks source link
miniapp react wechat-mini-program

GojiJS

Goji Core Goji CLI Create Goji App

React ❤️ Mini Program

中文文档

English Documentation

Visions

GojiJS enables running React code on multi Mini Program platforms.

Features

You can use the latest version of React in GojiJS. Features including class / functional components, hooks, portal can work well on GojiJS.

For now, GojiJS supports these platforms:

Demo

In GojiJS you can write React code like this:

import React, { useState } from 'react';
import { View, Text, Button, render } from '@goji/core';
import styles from './index.css';

const App = () => {
  const [count, setCount] = useState(0);
  return (
    <View className={styles.wrapped}>
      <Text>{count}</Text>
      <Button onClick={() => setCount(count + 1)}>+</Button>
    </View>
  );
};

render(App);

For more details, see GojiJS official documentation website.