Getting Error Uncaught TypeError: value.replace is not a function
<p>Basically im Creating A Markdown Previewer In Reactjs As Of Now Im Getting Error like Uncaught TypeError: value.replace is not a function and Had No Idea What Causing It Any Help Here if I Remove this.format from here dangerouslySetInnerHTML={this.format((this.rawMarkup()))} /> works fine but while typing on input box if i press enter it is not taking me to next line</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var App =React.createClass({
    getInitialState:function(){
        return{
            value:"My Value"
        }
    },
    updateValue:function(modifiedValue){
        this.setState({
            value:modifiedValue
        })
    },

    format: function (value) {
        return { __html: value.replace(/\r?\n/g, '&lt;br&gt;') };
    },
    rawMarkup: function() {
        var rawMarkup = marked(this.state.value.toString(), {sanitize: true});
        return { __html: rawMarkup };
    },
    render:function(){
        return(
            &lt;div className="inputBox container-fluid"&gt;
                &lt;h1 className="text-center text-primary"&gt;Hello Coders !!!&lt;/h1&gt;
                &lt;div className="row"&gt;
                    &lt;div className="col-md-6 col-md-offset-1"&gt;
                        &lt;InputBox value={this.state.value} updateValue={this.updateValue}/&gt;
                    &lt;/div&gt;

                    &lt;div
                        className="outputBox col-md-6 col-md-offset-1"
                        dangerouslySetInnerHTML={this.format((this.rawMarkup()))} /&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        );
    }
});

var InputBox =React.createClass({
    update: function() {
        var modifiedValue = this.refs.initialValue.value;
        this.props.updateValue(modifiedValue);
    },

    render:function(){
        return(
            &lt;textarea type="text" value={this.props.value} onChange={this.update} ref="initialValue"&gt;
                        &lt;/textarea&gt;

        );
    }
});
ReactDOM.render(&lt;App /&gt;,
    document.querySelector("#app")
);</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8" /&gt;
    &lt;title&gt;React Tutorial&lt;/title&gt;
    &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;style&gt;
        .outputBox,textarea{
            width: 400px;
            border: 5px solid gray;
            margin: 0;
            height: 500px;
        }

    &lt;/style&gt;
&lt;/head&gt;
&lt;div id="app"&gt;&lt;/div&gt;
&lt;script src="demo.js" type="text/babel"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>