Giter Club home page Giter Club logo

lreact's Introduction

LReact

基本的reactjs相关,额外添加基本的应用demo

说明

branch有各自的开发版本

  • pro-cli: 基于脚手架构建
  • base-dev: 采用静态方式,构建应用

lreact's People

Contributors

dependabot[bot] avatar pachverb avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

pachverb

lreact's Issues

feature(compoents): jquery版,tab组件实现

Is your feature request related to a problem? Please describe.

UI组件和广义组件区分:
Juqery版本UI组件实现

Describe the solution you'd like
A clear and concise description of what you want to happen.

鉴别UI组件与广义组件的区别

实现Juqery-Tab组件功能

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

feat(life-cycle): 组件数据更新过程

Is your feature request related to a problem? Please describe.

组件数据更新过程,即相关hook理解。

Describe the solution you'd like

  • 数据更新相关hook
  1. getDerviedStatefromProp
  2. componentDitUpdate
  3. shouldComponentUpdate
  4. getSnapshotUpdate
  • state派生问题

feat(optimization): Immutable库与react组件结合使用

Is your feature request related to a problem? Please describe.

Immutable库与react组件结合使用

Describe the solution you'd like

  1. 探究这两者结合的性能优化
  2. immutable基本使用

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

docs(hoc-mixin): 区别hoc与mixin

Is your feature request related to a problem? Please describe.

比较HocMixin

Describe the solution you'd like

  • mixin:

而相对于mixin来说,mixin是通过抽离组价间功能逻辑,然后再向需要的组件传入此公共mixin, 这就明显加重了组件的逻辑,变得维护复杂度变高,具有一定的侵入性。

  • hoc:

更符合函数式编程思维,输入到输出的单一流特点,即透明,不可变更,无副作用特性。在react中,使用高阶组件的WrappedComponent是不会感受到高阶组件的存在的,也就是原始组件内部封装不受高阶组件影响,同时两者的结合还能为原始组件增强功能,比较明显的体现了高阶组件的无侵入特性

特别说明

React新标准中,已经放弃对mixin使用,因为从组件的设计和可维护角度讲,确实造成一定程度的副作用影响。【React v16.3】

feat(hoc): hight order component base

Is your feature request related to a problem? Please describe.

react高阶组件应用

  1. 高阶组件概念
  2. 高阶组件应用场景

Describe the solution you'd like

解决高阶组件应用案列

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

feat(event): react 事件相关

Is your feature request related to a problem? Please describe.

react事件

  1. react 事件与web原生事件差别
  2. react合成事件
  3. react事件与原生事件的结合

Describe the solution you'd like

探究react事件在业务场景中的应用

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

docs(lifecycle): 生命周期hook总结

Is your feature request related to a problem? Please describe.

  • 生命周期各阶段hook运作机制;
  • 结合业务场景,总结各阶段使用情况和差别

Describe the solution you'd like
md表格形式总结

feat(Tabr): react版tab组件封装实现

Is your feature request related to a problem? Please describe.
Tab-Ui组件与react业务组件差别校验

Describe the solution you'd like
比较jquery版tab实现与Tab组件实现,内部设计过程。

Describe alternatives you've considered
react版本Tab组件实现

Additional context
Add any other context or screenshots about the feature request here.

feature(jsxdom): jsx 属性相关

Is your feature request related to a problem? Please describe.

组件元素和DOM元素类型属性差别比较

Describe the solution you'd like

自定义属性和原生属性使用

feat(key): 动态子组件多子组件渲染情况

Is your feature request related to a problem? Please describe.

动态子组件多子组件返回情况

Describe the solution you'd like
key的传递

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

feat(communication-callback): 子父组件通信之回调函数

Is your feature request related to a problem? Please describe.
子父组件通信之回调函数

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

feat(cssModule): cssmodule方案引入

Is your feature request related to a problem? Please describe.

CssModule方案

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

feat(hoc-searchselect): 搜索选择框实现

Is your feature request related to a problem? Please describe.

基于组件设计的组合模式,实现组件界面细粒度组合控制;结合高级组件,实现组件内部的逻辑复用

Describe the solution you'd like

  1. 组件细粒度拆分
  2. 高阶组件逻辑复用

docs(event): 合成事件机制原理

Is your feature request related to a problem? Please describe.

总览

React合成机制原理理解: 合成事件即所有事件类型都是通过合成事件机制去协调的。组件内部定义的事件处理器并不是我们直接需要调用的

参考

合成事件机制原理

wonfix(source): React.Component顶层组件对象源码

React顶层组件对象的source-code

function Component(props, context, updater) {
  this.props = props;
  this.context = context; // If a component has string refs, we will assign a different object later.

  this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  // renderer.

  this.updater = updater || ReactNoopUpdateQueue;
}

Component.prototype.isReactComponent = {};
/**
 * Sets a subset of the state. Always use this to mutate
 * state. You should treat `this.state` as immutable.
 *
 * There is no guarantee that `this.state` will be immediately updated, so
 * accessing `this.state` after calling this method may return the old value.
 *
 * There is no guarantee that calls to `setState` will run synchronously,
 * as they may eventually be batched together.  You can provide an optional
 * callback that will be executed when the call to setState is actually
 * completed.
 *
 * When a function is provided to setState, it will be called at some point in
 * the future (not synchronously). It will be called with the up to date
 * component arguments (state, props, context). These values can be different
 * from this.* because your function may be called after receiveProps but before
 * shouldComponentUpdate, and this new state, props, and context will not yet be
 * assigned to this.
 *
 * @param {object|function} partialState Next partial state or function to
 *        produce next partial state to be merged with current state.
 * @param {?function} callback Called after state is updated.
 * @final
 * @protected
 */

Component.prototype.setState = function (partialState, callback) {
  if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
    {
      throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
    }
  }

  this.updater.enqueueSetState(this, partialState, callback, 'setState');
};
/**
 * Forces an update. This should only be invoked when it is known with
 * certainty that we are **not** in a DOM transaction.
 *
 * You may want to call this when you know that some deeper aspect of the
 * component's state has changed but `setState` was not called.
 *
 * This will not invoke `shouldComponentUpdate`, but it will invoke
 * `componentWillUpdate` and `componentDidUpdate`.
 *
 * @param {?function} callback Called after update is complete.
 * @final
 * @protected
 */


Component.prototype.forceUpdate = function (callback) {
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
};

feat(component): 组件life-cycle 运行过程探究

Is your feature request related to a problem? Please describe.
组件生命周期运行原理,过程研究

Describe the solution you'd like

  1. 组件相关生命周期hook
  2. 组件生命周期hook,相互之间的关联

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.