Markdown Previewer Test #4

const Preview = (props) => {
      return (
        <div id="preview"
          __html: marked(props.input, {renderer: renderer, breaks: true})

            <Preview input={this.state.markdown} />

When I do it this way I fail lots of tests. When I switch the preview id to the parent div like below I only fail test #4:

<div id="preview"
    <Preview input={this.state.markdown} />

Then it says “#preview’s only children should be those rendered by marked.js”. I think it’s suggesting that I give the preview id to the root div rendered by the Preview function (like in the first snippet) but when I do that I fail lots of tests even though the app’s function doesn’t change in any way. I feel like moving on since I’ve been tinkering with this one test for hours.

hello and welcome to fcc forum :slight_smile:

share that codepen link as well, thats more interactive, happy learning :slight_smile:

I used create react app, there would be too many files to share.

give this article a try, happy reading :slight_smile: How to write ReactJS Code in Codepen.IO ? - GeeksforGeeks

Create-react-app creates git repo by default.

So you can create remote repo , link it to your local project and push stuff. Then give link to repository here.

You can even deploy it on github-pages, below is good guide how to do that:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.