Skip to content

Improve conditionals to avoid code littering #105

@gomorizsolt

Description

@gomorizsolt

(1) Instead of inline if conditions:

{settings.logo ? <Logo src={settings.logo} alt={settings.name} /> : null}

Use the && operator consistently(IIRC we already discussed this):

{settings.logo && <Logo src={settings.logo} alt={settings.name} />}

(2) Instead of && to ensure object fields:

{settings.header && settings.header.technologies ? (

Use the optional chaining operator:

{settings?.header?.technologies && ( ... )}

We may also find further improvements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions