mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Update outdated java custom view example on website
Summary:The custom java view example on the website frontpage was pretty outdated :) **Test plan (required)** Tested by running the website locally. Closes https://github.com/facebook/react-native/pull/6435 Differential Revision: D3045976 fb-gh-sync-id: 7b9c48fe78988a7f2b329427a477a28abac99f11 shipit-source-id: 7b9c48fe78988a7f2b329427a477a28abac99f11
This commit is contained in:
parent
b5985cf690
commit
cdb2d2ee79
19
website/src/react-native/index.js
vendored
19
website/src/react-native/index.js
vendored
@ -328,15 +328,9 @@ var Message = React.createClass({
|
||||
{`// Java
|
||||
|
||||
public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
|
||||
|
||||
private static final String REACT_CLASS = "MyCustomView";
|
||||
|
||||
@UIProp(UIProp.Type.STRING)
|
||||
public static final String PROP_MY_CUSTOM_PROPERTY = "myCustomProperty";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
return "MyCustomView";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -344,13 +338,9 @@ public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
|
||||
return new MyCustomView(reactContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView(MyCustomView view, ReactStylesDiffMap props) {
|
||||
super.updateView(view, props);
|
||||
|
||||
if (props.hasKey(PROP_MY_CUSTOM_PROPERTY)) {
|
||||
view.setMyCustomProperty(props.getString(PROP_MY_CUSTOM_PROPERTY));
|
||||
}
|
||||
@ReactProp(name = "myCustomProperty")
|
||||
public void setMyCustomProperty(MyCustomView view, String value) {
|
||||
view.setMyCustomProperty(value);
|
||||
}
|
||||
}
|
||||
`}
|
||||
@ -387,4 +377,3 @@ module.exports = MyCustomView;
|
||||
});
|
||||
|
||||
module.exports = index;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user