Skip to content

Conversation

@dehbmarques
Copy link

Related to #13.

I added one customHeadingComponent prop in the ColumnDefinition.
When a component is defined in this customHeadingComponent prop, it will be rendered instead of the default title + sortIcon.
eg:

class Header extends Component {

  render() {
    return (
      <span>Custom {this.props.title} {this.props.sortIcon}</span>
    );
  }
}

export default class App extends Component {

  render() {

    return (
      <Griddle data={fakeData}>
        <RowDefinition>
          <ColumnDefinition id="name" customHeadingComponent={Header} />
          <ColumnDefinition id="city" />
        </RowDefinition>
      </Griddle>
    );
  }
}

I kept the customHeadingComponent propType as an object, like the customComponent.
But shouldn't it be an element?

Great component btw. I've been using a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant