question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

about the styles of parentheses with JSX

See original GitHub issue

this is what i want (styles1)

const SearchAddress = () => (
  <div className={styles.container}>
    <InputField
      name="area"
      value=""
      iconName="zoom1"
      onInputChange={() => {}}
    />
  </div>
);

and this is formatted by prettier (styles2)

const SearchAddress = () =>
  (<div className={styles.container}>
    <InputField
      placeholder="小区/街道/写字楼等"
      name="area"
      value=""
      iconName="zoom1"
      onInputChange={() => {}}
    />
  </div>);

i i can’t find out the reasons. some days before when i used prettier-eslint-code i was correct. and now i change to use prettier with prettier.eslintIntegration settings. if i just use eslint --fix it diden’t format to styles2.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ntottencommented, Aug 9, 2019

This issue appears to be resolved as such I am closing it. If you are still having problems please feel free to reopen.

0reactions
github-actions[bot]commented, Apr 12, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When should I use curly braces { } and parenthesis ( ) in React?
Curly braces { } are special syntax in JSX. It is used to evaluate a JavaScript expression during compilation. A JavaScript expression can...
Read more >
JavaScript in JSX with Curly Braces - React Docs
JSX attributes inside quotes are passed as strings. · Curly braces let you bring JavaScript logic and variables into your markup. · They...
Read more >
React, Part I: JSX Cheatsheet - Codecademy
A JSX expression that spans multiple lines must be wrapped in parentheses: ( and ) . In the example code, we see the...
Read more >
What do curly braces mean in JSX (React)? - Stack Overflow
The outer curly braces tell the JSX parser that the syntax should be interpreted as javascript. The inner braces are used because the...
Read more >
JavaScript in JSX with Curly Braces - YouTube
When we want to add dynamic content to our HTML-like markup inside a JavaScript file we use curly braces. It's like our window...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found