Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom tooltip not work in class component #39

Closed
CryUshio opened this issue Sep 12, 2019 · 3 comments
Closed

Custom tooltip not work in class component #39

CryUshio opened this issue Sep 12, 2019 · 3 comments
Labels

Comments

@CryUshio
Copy link

When I do this

class Foo extends React.Component {
  renderTooltip = (...args) => {
      console.info('tooltip', args);
      return (<p>test</p>);
  }
  render() {
    const { data, axes } = this.props;
    return (
      <Chart
        primaryCursor
        tooltip={this.renderTooltip}
        data={data}
        axes={axes}
      />
    );
  }
}

I got

Warning: Failed prop type: Invalid prop `tooltip` supplied to `HookWrapper`.

And it not work.

Can it support class component?

@mjoswig
Copy link

mjoswig commented Dec 5, 2019

I got the same issue. Is the prop for custom tooltips still supported or did it get removed?

@evenstephenr
Copy link

@chym123 @mjoswig is this still an issue for you on the latest version of react-charts?

@tannerlinsley
Copy link
Collaborator

The latest beta has a whole new API contract for rendering custom tooltips. Closing this for triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants