简体   繁体   中英

How can I give indentation to string of code snippet in react-code-blocks?

I am using "react-code-blocks" package from npm , In that I am trying to give indentation to code of string, Which I want to pass in "react-code-blocks".

String Which i was passing

code:

interface Shape {
          double getArea();
          default String getDescription() {
              return "This is a shape with an area of " + getArea();
          }
      }

And It Show as, `

Now, Question Is how can I give indentation or format this string of code snippet.

Unfortunately you can't. You should be using indent string of code. You can use any online beautifier or prettier for this purpose

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM