Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Element is not removed from corresponding buffer when passed as prop unless element is in current buffer #189

Open
@zetachang

Description

@zetachang

A bug occurred while investigating #122,

class MyComponent
  include React::Component
  param :tip

  def render
    div {
      params.tip
    }
  end
end

class TooltipExample
  include React::Component

  def render
    tip = span { "this is a tip" } # <---- key is that the element is generated outside
    div(id: "outer") {
      MyComponent(tip: tip) # < ---- where its used 
    }
  end
end

will raise

Exception raised while rendering #TooltipExample:0x209c: a component's render method must generate and return exactly 1 element or a string.
Instead 2 elements were generated.

The span { "this is a tip" } is not removed from the correct buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions