Open carlisliu opened 2 years ago
Rax Core
import { Component } from 'rax'; class UndefinedDemo extends Component { constructor(props) { super(props); this.state = { alwaysUndefined: false, }; } render() { return ( <div> {this.state.alwaysUndefined ? undefined : undefined} <button onClick={() => { this.setState({ alwaysUndefined: !this.state.alwaysUndefined }); }} > Switch </button> </div> ) } }
reference: fix: render returns null to null empty nodes are also rebuilt(#1830) #1842
shouldUpdateComponent method should also checkundefined type.
undefined
current: undefined node is rebuilt
expected: undefined node is updated
Rax Version: 1.2.2
No response
The problem has been solved https://github.com/alibaba/rax/pull/2275
⌨️
Rax Core
Minimal code and steps to reproduce the bug
reference: fix: render returns null to null empty nodes are also rebuilt(#1830) #1842
shouldUpdateComponent method should also check
undefined
type.Current and expected behavior
current: undefined node is rebuilt
expected: undefined node is updated
Environment
Rax Version: 1.2.2
build.json
No response
Possible solution
No response
Additional context
No response