嗨,我有一个组件,我在我的反应应用程序中集成了redux.我打开第二个然后是第三个组件.我不希望将我在第一个组件中获得的数据传递给道具中的第二个然后第三个.
我想使用redux store来做到这一点.有没有办法做到这一点?
App.js
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
import RoundedButton from "./RoundedButton";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import * as actions from "./actions/index";
class App extends Component {
constructor(props) {
super(props);
this.state = {
score: 0,
status: "",
userSelected: "",
computerSelected: "",
visibility: [true, true, true],
buttonVisibility: false
};
this.clickitem = this.clickitem.bind(this);
this.handlePlayAgain = this.handlePlayAgain.bind(this);
}
handlePlayAgain() {
this.setState({
buttonVisibility: false,
visibility: [true, true, …Run Code Online (Sandbox Code Playgroud)