Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.3章 #2

Closed
RubyLouvre opened this issue Mar 27, 2017 · 0 comments
Closed

9.3章 #2

RubyLouvre opened this issue Mar 27, 2017 · 0 comments

Comments

@RubyLouvre
Copy link
Owner

toVnode里面添加

  var instance = new Type(props, context)
                    //必须在这里添加vnode,因为willComponent里可能进行setState操作
 instance.vnode = vnode 

Component.call(instance, props, context) //重点!!

React.js里面添加

    transaction.isInTransation = true
    var root = toVnode(vnode, {})
    transaction.isInTransation = false

Component.js的updateComponentProxy

    if (!instance.vnode.dom) {
        var parentNode = instance.container
        instance.state = this.state //将merged state赋给它
        toDOM(instance.vnode, instance.context, parentNode)
    } else {
RubyLouvre pushed a commit that referenced this issue Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant