My current challenge involves using a state as a variable for my query in order to fetch data from graphQl. However, I'm encountering an issue where the component does not read the state correctly.
Any suggestions on how to solve this?
class usersScreen extends Component {
constructor(props) {
super(props);
var white = 'sdfss';
console.log(props)
this.animatedValue = new Animated.Value(0)
this.state = {
active : true,
clientId: "5acc83c4658e6c2c70b3fe1d"
};
};
}
export default graphql(GET_CLIENT_USERS, {
options:(state) => (console.log(state),{
variables:{
clientId:this.state.clientId}})
})(usersScreen);