mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
BREAKING [react_native] Move to new C-based implementation of css-layout in RN Android
Summary: Moves from CSSNodeDEPRECATED to CSSNode. This has shown to be a huge performance win for layout time within FB. This is BREAKING because CSSNode contains bug fixes that were not migrated to CSSNodeDEPRECATED which may change the way your layout appears. The most common of these by far involves `flex: 1`. Previously, developers had to put `flex: 1` in many places it didn't belong in order to work around a bug in css-layout. Now `flex: 1` is treated properly and, unfortunately, this means that your layout may no longer look correct. Specifically, you may see that your layout looks collapsed, or children don't render. The fix is to simply remove `flex: 1` from those containers. Reviewed By: emilsjolander Differential Revision: D3992787 fbshipit-source-id: 7a3a2a34a8941c0524e6ba3c5379e434d3e03247
This commit is contained in:
committed by
Facebook Github Bot
parent
27817bed0e
commit
d63ba47b59
@@ -9,11 +9,11 @@
|
||||
|
||||
package com.facebook.react.views.text;
|
||||
|
||||
import com.facebook.csslayout.CSSNodeDEPRECATED;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
/**
|
||||
* Base class for {@link CSSNodeDEPRECATED}s that represent inline images.
|
||||
* Base class for {@link CSSNode}s that represent inline images.
|
||||
*/
|
||||
public abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode {
|
||||
|
||||
@@ -22,5 +22,4 @@ public abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode {
|
||||
* place of this node.
|
||||
*/
|
||||
public abstract TextInlineImageSpan buildInlineImageSpan();
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.facebook.common.util.UriUtil;
|
||||
import com.facebook.csslayout.CSSNodeDEPRECATED;
|
||||
import com.facebook.drawee.controller.AbstractDraweeControllerBuilder;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
@@ -26,7 +25,7 @@ import com.facebook.react.views.text.ReactTextInlineImageShadowNode;
|
||||
import com.facebook.react.views.text.TextInlineImageSpan;
|
||||
|
||||
/**
|
||||
* {@link CSSNodeDEPRECATED} that represents an inline image. Loading is done using Fresco.
|
||||
* Shadow node that represents an inline image. Loading is done using Fresco.
|
||||
*
|
||||
*/
|
||||
public class FrescoBasedReactTextInlineImageShadowNode extends ReactTextInlineImageShadowNode {
|
||||
@@ -113,5 +112,4 @@ public class FrescoBasedReactTextInlineImageShadowNode extends ReactTextInlineIm
|
||||
public @Nullable Object getCallerContext() {
|
||||
return mCallerContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user