Search code examples
cssreactjsreact-propsline-breaks

I want to add a line break when passing a string value to props


I want to add a line break when passing a string value to props I have tried "Unsere \nLeidenschaft" and {"Unsere \nLeidenschaft" } both but it is not working it break the line but it shows \n also with the text.

Here is my code:

I want to break the text of heading.

 <BgImageComponent
        DashSize={"35%"}
        Heading="Unsere Leidenschaft"
        SubHeading={"Das Team von Agento Aurum ist..."}
      />

Solution

  • I have found the solution you have to seprate the strings and then put
    it should be like this {["Unsere",
    , "Leidenschaft"]}!