Support React
See original GitHub issueCurrently it is not possible to use this library with React (easily).
Some modifications are needed to use it.
I want to discuss what should happen in this repository and what not.
I already did small changes to use it as a simple React component.
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Frappe from 'frappe-charts/src/scripts/charts.js'
import 'frappe-charts/dist/frappe-charts.min.css' // to import styling
class Chart extends Component {
componentDidMount() {
const {title, data, type = 'bar', height = 250} = this.props
this.c = new Frappe({
parent: this.chart,
title,
data,
type,
height
})
}
render() {
return <div ref={chart => (this.chart = chart)}/>
}
}
export default Chart
I created a demo repo for showcase: https://github.com/tobiaslins/frappe-charts-react-example
Issue Analytics
- State:
- Created 6 years ago
- Reactions:18
- Comments:22 (6 by maintainers)
Top Results From Across the Web
Where To Get Support - React
Where To Get Support. React has a community of millions of developers. On this page we've listed some React-related communities that you can...
Read more >React | endoflife.date
React is an open-source JavaScript web framework for building modern web applications. Release, Released, Active Support, Security Support, Latest. 18.2, 6 ...
Read more >Supported Browsers and Features | Create React App
For a set of polyfills to support older browsers, use react-app-polyfill. Supported Language Features. This project supports a superset of the ...
Read more >6 Best React Communities to get Information and Support
6 Best React Communities to get Information and Support · 1. Dev's React Community · 2. Hashnode's React Community · 3. Reactiflux ·...
Read more >React Experts to Help, Mentor, Review Code & More
Find a freelance React expert for help with reviewing code, mentorship, tutoring, and other React help you might need.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tobiaslins, Could you add your credits to our README with reference to your example? 😄
I’m using the latest version of Frappe Charts and it was quite easy to use in React JS.
In my App render() {}:
Then in the same file, under the App component: