**Fails to run first if condition.**   

So once component is loaded it shows "Student Progress related Stats" and when once topic-link is set(in some other component **which is removed too properly**) it shows second display. **Everything works fine till now** but when topic-link is removed if fails to run first if condition and shows second display still. Basically I want to change my component view based on topic-link is there or not.

```js
import React, { Component } from "react";
import {connect} from 'react-redux';

import {getQuestionsList} from '../../store/actions/questionActions';

class Test extends Component {

    render(){            
        let display;
        let topicLink = localStorage.getItem('topic-link');

        if(!topicLink){
            display = 
                <div style={{textAlign:'center',
                            fontSize:'22px'}}>
                    <p>Student Progress related Stats</p>
                </div>
        }
        else if(topicLink){
            display = 
                this.props.questions.map(question => (
                    <div key={question.id} style={{border:'1px solid #000',marginBottom:'15px'}}>
                        <div dangerouslySetInnerHTML={{__html: question.direction}} />
                        <div dangerouslySetInnerHTML={{__html: question.question}} />
                        <div>
                            <form>
                                <input type="radio" name="option" value="(A)"/>{question.option_a}<br/>
                                <input type="radio" name="option" value="(B)"/>{question.option_b}<br/>
                                <input type="radio" name="option" value="(C)"/>{question.option_c}<br/>
                                <input type="radio" name="option" value="(D)"/>{question.option_d}
                            </form>
                        </div>
                    </div>
                ))
        }

        return (
            <div>
                {display}
            </div>
        );
    }
};

const mapStateToProps = state => {
    return {
        questions: state.questions.items,
    }
}

export default connect(mapStateToProps, {getQuestionsList})(Test);
```