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

百度小程序种3.105.17及以上调试基础库,子组件状态变化,不会触发不渲染更新。 #1184

Open
thisTom opened this issue Nov 12, 2019 · 7 comments
Labels

Comments

@thisTom
Copy link

thisTom commented Nov 12, 2019

bug描述
百度小程序种3.105.17及以上调试基础库,子组件状态变化,不会触发不渲染更新。

复现bug的步骤
nanachi init test (默认模板)
cd test && npm i
nanachi watch

pages index index.js替换为如下测试代码:

import React from '@react';
import Welcome from '@components/Welcome/index';
class P extends React.Component {
    constructor() {
        super();
        this.state = {
            name: 'name'
        }
    }
    render() {
        return (
            <div>
                <div>子组件问题:</div>
                <Welcome name={this.state.name} />
            </div>
        );
    }
    componentWillMount(){
        setTimeout(()=>{
            this.setState({name: 'new name'})
        }, 3000)

    }
}

export default P;

components Welcome index.js 替换为如下测试代码

import React from '@react';
class Welcome extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            name: props.name
        };
    }
    componentWillReceiveProps(props){
        console.log(props);
        this.setState({
            name: props.name
        });
    }
    render() {
        return (
            <h2>Hello, {this.state.name}.</h2>
        );
    }
}

export default Welcome;

将小程序调试基础库设置为3.105.17或更高版本。3.105.17及以下版本无异常。
问题截图
下图为3.105.17以下版本无异常截图
QQ截图20191112173921
下图为3.105.17及以下版本异常截图
QQ截图20191112173839

编译环境信息

  • nanachi-cli 版本:1.0.9
  • nodejs版本、npm版本:[node v10+、npm 5.6.0]
  • 小程序IDE 版本: 2.15.3
  • 电脑操作系统: win10

运行环境信息

  • 端版本: 百度小程序开发工具2.15.3

百度小程序官方建议排查https://smartprogram.baidu.com/forum/topic/show/70128,因为3.105.17有一个非兼容性更新。
上个BUG #1183 (comment) 被关闭了。线上问题 ,希望得到帮助,可以尽快回复

@thisTom thisTom added the bug label Nov 12, 2019
@thisTom
Copy link
Author

thisTom commented Nov 12, 2019

感谢,希望可以尽快得到回复

@RubyLouvre
Copy link
Owner

https://github.com/RubyLouvre/anu/tree/branch3/dist

使用这个试试。我们周五会发一版。

@thisTom
Copy link
Author

thisTom commented Nov 13, 2019

https://github.com/RubyLouvre/anu/tree/branch3/dist

使用这个试试。我们周五会发一版。

非常感谢,分之三 解决了问题

@thisTom
Copy link
Author

thisTom commented Nov 25, 2019

https://github.com/RubyLouvre/anu/tree/branch3/dist

使用这个试试。我们周五会发一版。

还没发版本么?

@RubyLouvre
Copy link
Owner

已经发了

@RubyLouvre
Copy link
Owner

还没有好吗

@RubyLouvre
Copy link
Owner

你要删掉本地的ReactBu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants