I can't render codes as a paragraph in React

Published: (December 7, 2025 at 11:24 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Problem

I’m trying to render a block of code as a paragraph inside a React component, but it isn’t displaying correctly.

Code

const VideoExample = () => {
  const VideoCode = function Video({ video }) {
    return (
      <>
        
### {video.title}

        
{video.description}

      
    );
  };

  return (
    
      
        Create user interfaces 
 from components
      
      
        
          React lets you build user interfaces out of individual pieces called
          components.
        
        
          Create your own React components like{' '}
          Thumbnail,{' '}
          LikeButton, and{' '}
          Video.
        
        
Then combine them into entire screens, pages, and apps.

      

      
        
          
            
Video.js

          
          
            
              `{VideoCode}`
            
          
        
      
    
  );
};

export default VideoExample;

Result

Rendered output

Back to Blog

Related posts

Read more »

Challenge no. 1 - User Avatar

Communities DEV Community !DEV Community Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-...

The fuck off contact page

Article URL: https://www.nicchan.me/blog/the-f-off-contact-page/ Comments URL: https://news.ycombinator.com/item?id=46189994 Points: 182 Comments: 74...