Files
react-native/packages/react-native-codegen/buck_tests/java/BooleanPropNativeComponentViewManager.java
T
Oleksandr Melnykov bf89d1d536 Allow null as default value for boolean props
Summary: Some props must have their default values set by native. To be able to support this, we have to introduce a `null` as a supported default value for some types. In this diff I'm adding support for `null` default values for boolean props. Check D17260168 for the example of the usage of the nullable boolean values.

Reviewed By: rickhanlonii, TheSavior

Differential Revision: D17258234

fbshipit-source-id: 63b7864be97856704d5964230526f23c0e395a67
2019-09-23 07:18:08 -07:00

34 lines
1.1 KiB
Java

package com.facebook.react.uimanager;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.facebook.react.viewmanagers.BooleanPropNativeComponentViewManagerDelegate;
import com.facebook.react.viewmanagers.BooleanPropNativeComponentViewManagerInterface;
public class BooleanPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
implements BooleanPropNativeComponentViewManagerInterface<ViewGroup> {
public static final String REACT_CLASS = "BooleanPropNativeComponentView";
@Override
public String getName() {
return REACT_CLASS;
}
private void test() {
BooleanPropNativeComponentViewManagerDelegate<ViewGroup, BooleanPropNativeComponentViewManager>
delegate = new BooleanPropNativeComponentViewManagerDelegate<>(this);
}
@Override
public ViewGroup createViewInstance(ThemedReactContext context) {
throw new IllegalStateException();
}
@Override
public void setDisabled(ViewGroup view, boolean value) {}
@Override
public void setDisabledNullable(ViewGroup view, @Nullable Boolean value) {}
}