Is there a way to export a JavaScript React Class Component into a TypeScript file?
I have the following code:
Login.js
class Login extends Component {
constructor(props) {
super(props);
this.usernameText = React.createRef();
this.passwordText = React.createRef();
this.urlText = React.createRef();
this.keyPress = this.keyPress.bind(this);
}
.
.
.
}
export default Login;
index.ts
const Login = require("./uiManagement/jiraUI/Login/Login");
export {
Login as JiraUiLogin
}
In another project i did an npm import for the above to use the login component:
import { Component } from "react";
import { JiraUiLogin } from "infosysta-typescript-core";
class mLogin extends Component {
render() {
return (
<JiraUiLogin />
)
}
};
export default mLogin

moduleResolutionproperty in yourtsconfig.jsonfile?const Login = require("./uiManagement/jiraUI/Login/Login.js");try adding the extension, if that doesn't work use import instead of requiretsconfig.jsonwith us?