Skip to content

Setting custom colors for Separators in custom components #784

@CosmicClownTyler

Description

@CosmicClownTyler

While using <TableView> I was constantly adding a specific set of custom props to my <Section>s and <Cell>s, so I decided to extend them using custom components to simplify this process for myself. (This was just a different way of achieving the same effect of creating and exporting an object with custom props)

function CustomCell(props) {
  return (
    <Cell
      title={props.title}
      // default custom props would go here
    />
  );
}

However, in doing so, the colors of the separator insets reverted back to the default colors. After some exploring, including looking at this past issue, I discovered that the background color that is defined in the custom component is used to color the cell but not the separator inset.

This can be seen in the image below, with code written in a snack here.
image

The problem can be easily circumvented by simply using an object of reusable custom props instead of defining custom components, or by overwriting the component's background color (both options are shown in the snack), but I thought I would submit an issue so this can be fixed if any devs have time, and to also help out anyone else that runs into this issue.

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