Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.
This repository was archived by the owner on May 8, 2025. It is now read-only.

support for fragments #38

@davidmarkclements

Description

@davidmarkclements

The following will fail with error:

TypeError: Cannot convert a Symbol value to a string
const cmp = () =>  {
  return (<Style>
    {styles}
    <>
    <label htmlFor={name} className="label">{label}</label>
    <input ref={ref} id={name} name={name} className="text-input"/>
    <button onClick={onButtonClick} className="button">{buttonText}</button>
    </>
  </Style>)
}

The error comes from this line https://github.com/buildbreakdo/style-it/blob/master/src/index.js#L303 and it's because React.Fragment is a symbol

I realise the approach for this may have to deviate from the current approach (e.g. it'll probably require prefixing the generated scope class string to all classes on elements within a fragment) - but it would also be handy if it "Just Worked" and fits well with the philosophy of optimizing for user consumption.

Also this may or may not relate to #25

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