Skip to content

Feature: support custom hunk separator with React #440

@jonatanklosko

Description

@jonatanklosko

Prerequisites

Proposal

Respect options.hunkSeparators when passed to React components, or/and provide an API similar to renderAnnotation.

Motivation and context

Currently defining a custom rendering for hunkSeparators only works with the JS API. Ideally there should be a way to override it, while using the higher-level React components.

I understand there may be challenges with rendering the custom separator as React element. However, is there a reason the underlying options.hunkSeparators -> Element couldn't be respected when passed to the React component? I don't mind the rendering itself being JS DOM operations, if necessary.

Currently passing a function to options.hunkSeparators in the React component enables "custom" mode, but does not render the separators, so the separators are effectively gone, which I was confused about initially.

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