I'm trying to add this simple div
to the return block of my .tsx file:
<div id="bizible.reportUser" style="display:none" data-email="[email protected]"/>
I do it the following way:
import React from 'react';
import Radium from 'radium';
import Icon from './Icon';
import Header from './Header';
import Colors from '../colors';
const NoMatch = ({ children, title, icon, kind }) => {
return ([
<div style={[styles.base, kind && styles[kind]]}>
<Icon name={icon} style={[styles.icon]} height="48" width="48" />
<Header title={title} style={[styles.header]} />
<p style={[styles.message]}>
{children}
</p>
</div>,
<div id="bizible.reportUser" style="display:none" data-email="[email protected]"/>
]
);
};
But it returns an Error message and does not compile:
error TS2322: Type '({children, title, icon, kind}: { children: any; title: any; icon: any; kind: any; }) => Element[]' is not assignable to type 'StatelessComponent<Props>'.
Type 'Element[]' is not assignable to type 'ReactElement<any>'.
Property 'type' is missing in type 'Element[]'.
()
? I.e from([ ... ])
to()
. – Korfontadiv
as the topmost element, so there is no need for an array is this case. – Korfonta