Skip to content

Add readme for arrow function returns#210

Merged
ylvaselling merged 1 commit intomasterfrom
feature/update-readme-arrow-functions
Mar 30, 2026
Merged

Add readme for arrow function returns#210
ylvaselling merged 1 commit intomasterfrom
feature/update-readme-arrow-functions

Conversation

@ylvaselling
Copy link
Copy Markdown
Collaborator

Lmk if you agree

@ylvaselling ylvaselling merged commit fb6d4e5 into master Mar 30, 2026
1 check passed
@ylvaselling ylvaselling deleted the feature/update-readme-arrow-functions branch March 30, 2026 11:42
@WeirdRubberDuck
Copy link
Copy Markdown
Collaborator

WeirdRubberDuck commented Mar 30, 2026

Just realized: Do we want to make an exception for things like onClick functions on components? In those cases, it is already quite clear that there is not value being retuned, I guess, and adding the extra lines makes the rendered component harder to overview (at least in my opinion)

For example:

  if (visibility === 'Fading') {
    return (
      <ActionIcon onClick={() => updateValue(!checked, isImmediate)}>
        <FadeIcon  />
      </ActionIcon>
    );
  }

compared to:

  if (visibility === 'Fading') {
    return (
      <ActionIcon
        onClick={() => {
          updateValue(!checked, isImmediate);
        }}
      >
        <FadeIcon />
      </ActionIcon>
    );
  }

In this case, I'm not a fan of the extra clutter that the {} and ; add, but that's only my personal opinion

@ylvaselling @engbergandreas @alexanderbock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants