CustomRendererProps
interface
CustomRendererProps
<
 Â
T
extends
TNode
>
{
 Â
InternalRenderer
:
InternalRenderer
<
T
>
;
 Â
TDefaultRenderer
:
TDefaultRenderer
<
T
>
;
 Â
TNodeChildrenRenderer
:
ComponentType
<
TNodeChildrenRendererProps
>
;
 Â
nativeProps
?
:
Omit
<
ReactNativeProps
,
"style"
>
   Â
&
{
     Â
onPress
?
:
(
)
=>
void
;
   Â
}
   Â
&
{
     Â
style
?
:
StyleProp
<
ViewStyle
>
;
   Â
}
;
 Â
onPress
?
:
(
e
:
GestureResponderEvent
)
=>
void
;
 Â
propsFromParent
?
:
PropsFromParent
;
 Â
renderIndex
:
number
;
 Â
renderLength
:
number
;
 Â
sharedProps
:
RenderHTMLAmbiantSharedProps
;
 Â
style
:
NativeTextStyles
|
NativeBlockStyles
;
 Â
textProps
:
TextProps
;
 Â
tnode
:
T
;
 Â
type
:
"text"
|
"block"
;
 Â
viewProps
:
ViewProps
;
}
Props for custom renderers, such as provided in the renderers
prop.
#
Type ParametersT
#
The concrete type of ​TNode
.
#
FieldsInternalRenderer
#
Internal renderer for this tagName, not to be confused with
​TDefaultRenderer
, which is the fallback renderer for any ​TNode
.
Remarks
For example, when rendering img
tags, TDefaultRenderer
and
InternalRenderer
won't be equal.
When there is no internal renderer for this tag, this prop will fallback
to TDefaultRenderer
.
TDefaultRenderer
#
Default renderer for this ​TNode
.
TNodeChildrenRenderer
#
A component to render children of a tnode
.
nativeProps
#
nativeProps
?
:
Omit
<
ReactNativeProps
,
"style"
>
 Â
&
{
   Â
onPress
?
:
(
)
=>
void
;
 Â
}
 Â
&
{
   Â
style
?
:
StyleProp
<
ViewStyle
>
;
 Â
}
;
Props passed to the underlying React Native element, either Text
or
View
. See also ​textProps
and
​viewProps
.
Remarks
The prop.style
property will have a greater specificity
than computed styles for this ​TNode
. E.g. style={[computedStyle,
nativeProps.style, viewProps.style]}
.
onPress
#
onPress
?
:
(
e
:
GestureResponderEvent
)
=>
void
;
Any default renderer should be able to handle press.
propsFromParent
#
Props passed by direct parents.
renderIndex
#
renderIndex
:
number
;
The position of this React element relative to the parent React element, starting at 0.
Remarks
Not to be confused with ​index
, which is
the position of the TNode before hoisting. The latter is much closer
to an intuitive understanding of the position of a DOM node in the DOM
tree.
renderLength
#
renderLength
:
number
;
The total number of elements children of this React element parent.
sharedProps
#
Props shared across the whole render tree.
style
#
Styles extracted with ​getNativeStyles
.
textProps
#
textProps
:
TextProps
;
Props passed to the underlying Text
element (type
must be 'text'). See
also ​nativeProps
and
​viewProps
.
Remarks
The textProps.style
property will have a greater specificity than
computed styles for this ​TNode
. E.g. style={[computedStyle,
nativeProps.style, textProps.style]}
.
tnode
#
tnode
:
T
;
The ​TNode
to render.
type
#
type
:
"text"
|
"block"
;
Is the underlying component Text
or View
?
viewProps
#
viewProps
:
ViewProps
;
Props passed to the underlying View
element (type
must be 'view'). See
also ​nativeProps
and
​textProps
.
Remarks
The viewProps.style
property will have a greater specificity than
computed styles for this ​TNode
. E.g. style={[computedStyle,
nativeProps.style, viewProps.style]}
.