I am new to react. I am using redux and I am writing actions and reducers using that in reducer I am setting state, using that state in my code I need to write a condition. When it’s true I need to display the function renderAutomaticSports
or don’t display the function renderAutomaticSports
in componentWillMount
.
I am dispatching the retrieveSportsDetails
function, but I’m not sure how to write the if
condition.
The code snippet is below. Can you help me?
import React, {Component} from 'react';
import {moneyFormat} from '../../common/mixin-money-format';
import {connect} from 'react-redux';
import moment from 'moment';