-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat: implement chart component #377
Conversation
fixes #347 |
…0milesbridge/react-rainbow into implement-chart # Conflicts: # package.json
src/components/Chart/index.js
Outdated
return ( | ||
<div> | ||
<span className="rainbow-chart_dataset-container" aria-hidden> | ||
<Provider value={{ privateRegister: this.registerDataset }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every time you do something like prop={{ value }} ... the object gets create in every execution of the render method. You can cache this instead by doing
this.contextValue = {
privateRegister: this.registerDataset.bind(this),
}
then in the component render you pass the contextValue directly .. created only one time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other observation, use Symbol to hide private methods and variables
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "react-rainbow-components", | |||
"version": "0.6.0", | |||
"version": "0.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is incorrect. Are we going back in time? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry a got mixed on the merge
can we implement this without React context, since inside of component you can pass We can just iterate for the dataset in componentDidUpdate ... get the data passed then update the charts this implementation does not guarantee reactivity since the charts only is created and updated one time. Every time props values change in Chart or DataSet the chart must be updated. tips:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with the first pass
No description provided.