---
title: "Discussion on \"Preserving line breaks from an API string response when rendered in your React component\" | Hashnode"
description: "Discussion on \"Preserving line breaks from an API string response when rendered in your React component\". If you’ve ever worked with an API that returns a string containing line break characters and wrongly assumed they would be preserved by default when you render the text in your React component, then you’re not alone. I assumed the characters would be..."
url: "https://hashnode.com/posts/preserving-line-breaks-from-an-api-string-response-when-rendered-in-your-react-component/65aeb440b03364ccd1d4ec21"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Preserving line breaks from an API string response when rendered in your React component](https://tomelleyz.hashnode.dev/preserving-line-breaks-from-an-api-string-response-when-rendered-in-your-react-component?utm_source=hashnode&utm_medium=feed)

If you’ve ever worked with an API that returns a string containing line break characters and wrongly assumed they would be preserved by default when you render the text in your React component, then you’re not alone. I assumed the characters would be...

Jan 22, 2024 · 2 min read · tomelleyz.hashnode.dev  
Read the article

-   [#apis](https://hashnode.com/tag/apis)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#css](https://hashnode.com/tag/css)

## Written by

[Olasunkanmi Eleyinmi](https://hashnode.com/@tomelleyz)

@tomelleyz

  
[View profile](https://hashnode.com/@tomelleyz)

Software Developer

Software Developer

## Responses

Comments are turned off for this post.
