0
別のクラスの状態を変更しREACTJSは:私は2つのファイルReactjs <br> file1.jsを持って
class App extends Component {
constructor(props) {
super(props);
this.state = {
data: [],
selection: null
};
file2.js
class SearchBar extends Component {
InputChange =() => {
console.log(App.state);
}}
私が使用してクラスを使用するときに、クラスのアプリケーションの状態を変更したいですSearchBar、file2をfile1にインポートしました。ありがとうございました!私の英語は良くありません。
ファイル1とファイル2はどのような関係も共有しています。シップ、 –
リークガイドを読むことをお勧めします。 https://reactjs.org/docs/lifting-state-up.html – Kunukn