Skip to content
Advertisement

JavaScript/React Style Guide Indentation

Is there an agreed-upon convention for indentation in React JSX? 2 spaces, 4 spaces, tabs, etc.

Advertisement

Answer

You should just use the same indentation as the rest of your javascript code.

That said react ecosystem seems to use mostly double spaces so I’d use that for consistency.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement