Yes, you can use redux here to communicate with component A without using the parent component. Pass the data from component B to an action creator which will then, dispatch an action to a reducer. The reducer will return the state(which now holds the data) that you can access from component A. You will need to connect both A & B to the redux store.
Suppose you want "data" that you have in component A to also be accessible in component B.
class A extends React.Component{
//call this.props.actionCreator and pass it the data
}
export default connect(null, actionCreators)(A)
The action creator recieves the data, wraps it in an action and dispatches to the reducer. The reducer returns the data, which becomes part of the state.
class B extends React.Component{
//We can access data as this.props.data here
}
function mapDispatchToProps(state) {
return {data: state.LoginReducer.data};
}
export default connect(mapDispatchToProps, actionCreators)(B)
We then specify what piece of state we want inside mapDispatchToProps and pass it to the connect helper. The connect helper makes the data available as this.props.data inside component B.
I hope I explained it well enough.