mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
Fix button render with null or undefined child. (#5473)
* Fix button render with null or undefined child. Fix bug #5472 * Add missing semicolon * Make if statement braced. ......
This commit is contained in:
parent
d6d62f6754
commit
83f85a371a
@ -12,6 +12,10 @@ function isString(str) {
|
||||
|
||||
// Insert one space between two chinese characters automatically.
|
||||
function insertSpace(child) {
|
||||
// Check the child if is undefined or null.
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
if (isString(child.type) && isTwoCNChar(child.props.children)) {
|
||||
return React.cloneElement(child, {},
|
||||
child.props.children.split('').join(' '));
|
||||
|
Loading…
Reference in New Issue
Block a user