Skip to content

Loses class and other passed attributes #8

@OEvgeny

Description

@OEvgeny

I've noticed that createHOC looses data.attributes in produced components which leads to loosing class and other attributes in actual DOM.
E.g.

 export const BackBtn = createHOC(IconBtn, {
  name: 'BackBtn',
  functional: true,
  // render (h, ctx) {
  //   return h(IconBtn, { ...ctx.data, props: { ...ctx.props, icon: 'arrow_back' } })
  // }
}, {
  props: { icon: 'arrow_back' }
})

When using in template like

<back-btn class="green--text"></back-btn>

Does not include class green-text
But when defined like:


export const BackBtn = createHOC({}, {
  name: 'BackBtn',
  functional: true,
  render (h, ctx) {
    return h(IconBtn, { ...ctx.data, props: { ...ctx.props, icon: 'arrow_back' } })
  }
})

It does.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions