Use static constants instead of strings when referring to View Managers and Native Modules
Summary: Using strings to refer to Native Modules and View Managers in ReactPackages are prone to error. The compiler replaces the constants with the actual strings anyway, so using constants gives us better type safety Reviewed By: achen1 Differential Revision: D12843649 fbshipit-source-id: 7a7c6c854c8689193f40df92dc8426a3b37f82c8
This commit is contained in:
parent
d5fc0475af
commit
3443f75f9c
|
@ -56,7 +56,7 @@ import javax.annotation.Nullable;
|
||||||
@ReactModule(name = CameraRollManager.NAME)
|
@ReactModule(name = CameraRollManager.NAME)
|
||||||
public class CameraRollManager extends ReactContextBaseJavaModule {
|
public class CameraRollManager extends ReactContextBaseJavaModule {
|
||||||
|
|
||||||
protected static final String NAME = "CameraRollManager";
|
public static final String NAME = "CameraRollManager";
|
||||||
|
|
||||||
private static final String ERROR_UNABLE_TO_LOAD = "E_UNABLE_TO_LOAD";
|
private static final String ERROR_UNABLE_TO_LOAD = "E_UNABLE_TO_LOAD";
|
||||||
private static final String ERROR_UNABLE_TO_LOAD_PERMISSION = "E_UNABLE_TO_LOAD_PERMISSION";
|
private static final String ERROR_UNABLE_TO_LOAD_PERMISSION = "E_UNABLE_TO_LOAD_PERMISSION";
|
||||||
|
|
Loading…
Reference in New Issue