Code Monkey home page Code Monkey logo

reaux-next's Introduction

npm version downloads

动机

基于 nextreaux 数据流方案,统一数据流和应用结构,简化开发体验

reaux-next's People

Contributors

zedfight avatar

Stargazers

wangzh avatar gwangzh avatar  avatar Dai hailin avatar Perry Huang avatar  avatar  avatar chenfuqiang avatar

Forkers

gwangzh

reaux-next's Issues

Unhandled Runtime Error Error: Hydration failed because the initial UI does not match what was rendered on the server.

组件中嵌套了 connect 后的 Module View 会导致渲染异常:
Unhandled Runtime Error: Hydration failed because the initial UI does not match what was rendered on the server. See more info here: https://nextjs.org/docs/messages/react-hydration-error

// moudles/home/components/Main.tsx
import React from "react";
import { View as AboutView } from "modules/about";
export default function Index() {
    return (
        <div className="home">
            <About />
        </div>
    )
}

// moudles/about/components/Main.tsx
import React from "react";
export default function Index() {
    return (
        <div className="home">
            <About />
        </div>
    )
}

// moudles/about/index.ts
import React from "react";
import Main from "./components/Main";
import { register, Model, helper } from 'reaux-next';
import {connect} from "reaux";
interface  State {name: string}
const initialState: State = {
  name: 'about',
};
class ActionHandler extends Model<State> {
  async onUpdate(...args){
    console.info("about onUpdate", args)
  }
}

export const { actions, View } = connect((state)=>({name: state.about?.name}))(register(
  new ActionHandler('about', initialState),
  Main,
));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.