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

165 views Asked by At

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.

1

There are 1 answers

0
Chetan Kondawle On

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