react初心者です。
下記のような2ファイルがあり、
reactからjsファイルのfunctionを呼ぶ方法がわかりません。。
これって可能なのでしょうか?
testJs.js
function run() { console.log("こんにちは"); }
test.tsx
import * as React from 'react'; export interface Props { } export interface State { } export default class Test extends React.Component<Props, State> { constructor(props: Props) { super(props); } render() { return ( <div> <p>hello</p> </div> ) } componentDidUpdate() { // **ここでrunを呼びたい** // run(); } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。