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();
}
}
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