Skip to content

DefaultHandle should allow children #274

@timkelty

Description

@timkelty

I wanted to display the handle value, positioned below the handle.

The easiest way to do this seemed to be pass my own handle that rendered children with the label. eg:

const Handle = ({buttonOffset = 0, ...handleProps}) => {
  const value = handleProps['aria-valuenow'];

  return (
    <DefaultHandle {...handleProps}>
      <span
        style={{
          position: 'absolute',
          top: 30,
          left: 0,
          right: 0,
        }}
       >
        {value}
      </span>
    </DefaultHandle>
  );
};

Works great, except I get a propType warning, because DefaultHandle is expecting exact props:

Warning: Failed prop type: DefaultHandle: unknown props found: children

Seems like children could safely be added to it's allowed props?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions