# Extending dcc.Graph in React

**URL:** <https://community.plotly.com/t/extending-dcc-graph-in-react/66538>\
**Category:** Dash Python\
**Created:** [July 29, 2022, 1:11pm UTC](https://community.plotly.com/t/extending-dcc-graph-in-react/66538 "2022-07-29T13:11:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avr](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@avr](https://community.plotly.com/u/avr)\
**Post date:** [July 29, 2022, 1:11pm UTC](https://community.plotly.com/t/extending-dcc-graph-in-react/66538/1 "2022-07-29T13:11:50Z")

</div>

I am trying to extend some of the components in React with some functionality. I have installed dash core components though NPM and the code builds.

**TGraph.react.js**

```auto
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Graph from 'dash-core-components';

/**
 */

export default class TGraph extends Component {
    render() {
        const {id} = this.props;

        return(
            <Graph id={id}></Graph>
        );
    }
};

TGraph.defaultProps = {};

TGraph.propTypes = {
  id: PropTypes.string
};

```

This all builds but then when I want to use this in the following file:

```auto
import new_components
import dash
from dash import html

external_scripts = [
    'https://cdn.plot.ly/plotly-latest.min.js'
]
app = dash.Dash( __name__ ,
                external_scripts=external_scripts)

app.layout = html.Div(
    [
        new_components.TGraph(id="graph")
    ]
)

if __name__ == " __main__":
    app.run_server(debug=True)

```

The dash debugger gives me the following error:

> Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.
> 
> Check the render method of `i`.

I have tried importing the Graph with` import {Graph} from 'dash-core-components';` or with an alias as `import {Graph as DCCGraph} from 'dash-core-components';` as in [this question](https://community.plotly.com/t/using-a-dash-core-component-within-a-custom-component/41052), but that didn’t help. I can’t find what it is trying to render with “i”.

Can anyone help?
