Skip to content

[Google Lighthouse] Form elements do not have associated labels.  #22

Description

@Lhhim

ref.: https://web.dev/label/?utm_source=lighthouse&utm_medium=devtools

Suggestion

  1. Add "id" into , so that it supports separately for font-end element.

Example:

// landing_page.tsx
...
<label className="subscribe-title" htmlFor="EMAIL">
{signuptitle}
</label>
...
// react-mailchimp-form/src/index.js
...
        {fields.map(input => 
          <input
            {...input}
            key={input.name}
            id={input.name}
            onChange={({ target }) => this.setState({ [input.name]: target.value })}
            defaultValue={this.state[input.name]}
          />
        )}
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions