Below is my react components structure (Using TypeScript):
-App.tsx
-NewRequestForm.tsx
-EmployeeInfo.tsx
-AssetInfo.tsx
I am trying to import EmployeeInfo & AssetInfo in NewRequestForm, but while using import statement both components are not visible, but I can see Prop & States interfaces.
Please suggest how child components can be imported in my NewFormRequest.tsx
AssetInfo.tsx (child1)
import * as React from 'react';
export interface AssetInfoProps {}
export interface AssetInfoState {}
export default class AssetInfo extends React.Component<AssetInfoProps,
AssetInfoState> {
constructor(props: AssetInfoProps) {
super(props);
this.state = {};
}
public render() {
return <div />;
}
}
EmployeeInfo.tsx (Child2)
import * as React from 'react';
export interface EmployeeInfoProps {}
export interface EmployeeInfoState {}
export default class EmployeeInfo extends React.Component<EmployeeInfoProps,
EmployeeInfoState> {
constructor(props: EmployeeInfoProps) {
super(props);
this.state = {};
}
public render() {
return <div />;
}
}
NewRequestForm.tsx (Parent)
import * as React from 'react';
import {} from './EmployeeInfo';
import {} from './AssetInfo';
export interface NewRequestFormProps {}
export default class NewRequestForm extends
React.Component<NewRequestFormProps, any> {
public render() {
return <div />;
}
}
Remove the default
keyword for exporting the EmployeeInfo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With