mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Pass State to preallocateView and createView methods whenever possible
Summary: For some components, we will have state as soon as the ShadowNode is created that may be meaningful. In those cases, ViewManagers should be able to use State to create or preallocate views. FB: This will be used in following diffs for Litho support. Reviewed By: mdvacca Differential Revision: D15343702 fbshipit-source-id: 8fd672251cb88dea662b5cae5a9efc96877d28a9
This commit is contained in:
committed by
Facebook Github Bot
parent
c9df1db00a
commit
b05761f1bb
@@ -83,7 +83,7 @@ public class SimpleViewPropertyTest {
|
||||
|
||||
@Test
|
||||
public void testOpacity() {
|
||||
View view = mManager.createViewWithProps(mThemedContext, buildStyles(), new JSResponderHandler());
|
||||
View view = mManager.createView(mThemedContext, buildStyles(), null, new JSResponderHandler());
|
||||
|
||||
mManager.updateProperties(view, buildStyles());
|
||||
assertThat(view.getAlpha()).isEqualTo(1.0f);
|
||||
@@ -97,7 +97,7 @@ public class SimpleViewPropertyTest {
|
||||
|
||||
@Test
|
||||
public void testBackgroundColor() {
|
||||
View view = mManager.createViewWithProps(mThemedContext, buildStyles(), new JSResponderHandler());
|
||||
View view = mManager.createView(mThemedContext, buildStyles(), null, new JSResponderHandler());
|
||||
|
||||
mManager.updateProperties(view, buildStyles());
|
||||
assertThat(view.getBackground()).isEqualTo(null);
|
||||
|
||||
Reference in New Issue
Block a user