Yerel olarak yerel görünüm uygulamak için çalışıyorum ancak sahne ile ilgili bazı sorunlar yaşıyorum.Yerel özel görünümde tepki yok, doğal prop için propType yok
android.view.View
ve ViewManager
com.facebook.react.uimanager.SimpleViewManager
uzantısını genişleten bir sınıf CustomView
var.
bu şekilde yapılır React ile bağlanması:
'use strict';
var { requireNativeComponent, PropTypes } = require('react-native');
var iface = {
name: 'CustomView',
propTypes: {
myProp: PropTypes.string
},
};
module.exports = requireNativeComponent('CustomView', iface);
benim Tepki app kullanmak
, bu bir hata atar: SimpleViewManager
çünkü bazı standardını belirlemiştir
`CustomView` has no propType for native prop `CustomView.renderToHardwareTextureAndroid` of native type `boolean`
Bu edilir özellik gibi:
@ReactProp(name = PROP_BACKGROUND_COLOR, defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBackgroundColor(T view, int backgroundColor) {
view.setBackgroundColor(backgroundColor);
}
Yalnızca ifa'mdeki her özelliğin bildirilmesini düzeltebilirim ce nesnesi.
Tüm parçaları el ile listelemek istemiyorum, tüm bu sahnelere iftar etmeden onları tanımak için bir yol var mı? gibi
şey:
var {standardViewProps} = require('react-native');
var iface = {
name: 'CustomView',
propTypes: {
...standardViewProps,
myProp: PropTypes.string
}
}