From e98462f2e49999ed92ee2fcc3ff689ff25ddef27 Mon Sep 17 00:00:00 2001 From: bsinkule Date: Tue, 13 Nov 2018 18:01:38 -0700 Subject: [PATCH] Updated to newer React syntax --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0d793c8..5bb12af 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Installation ------------ This is a CommonJS component only (to be used with something like Webpack or Browserify) ``` -npm install --save react-chartjs +npm install react-chartjs-2 --save ``` You must also include [chart.js](https://www.npmjs.com/package/chart.js) and [React](https://www.npmjs.com/package/react) as dependencies. ``` @@ -26,13 +26,13 @@ npm install --save chart.js@^1.1.1 react react-dom Example Usage ------------- ```javascript -var LineChart = require("react-chartjs").Line; +import { Line } from "react-chartjs-2" -var MyComponent = React.createClass({ - render: function() { - return +class MyComponent extends React.Component { + render() { + return } -}); +}; ``` * ```data``` represents the chart data (see [chart.js](https://github.com/chartjs/Chart.js/tree/v1.1.1/docs) for details)