Skip to content

Support for non-boolean classNameBinding #2

@Turbo87

Description

@Turbo87

Using classNameBindings: ['foo'] is ambiguous and depends on the runtime value of the foo property.

  • foo: 'BarBaz' will cause class="bar-baz"
  • foo: true will cause class="foo"
  • foo: false will cause class=""
  • foo: '' 🤷‍♂

We will need to decide what we want to do about this. Currently the codemod skips components that use this pattern.

Alternatives:

  • Introduce a helper that resolves this issue at runtime.
  • Use an interactive prompt each time this pattern is encountered and ask the user if this ia s boolean or string property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions