Im not able to create a React component dynamically. I see blank page with no errors with below code.
1) Trying to create an element named "PieChart"
2) Below are the Two errors im seeing in console.
1. Warning: <PieChart /> is using incorrect casing. Use PascalCase for
React components, or lowercase for HTML elements.
2. Warning: The tag <PieChart/> is unrecognized in this browser. If you
meant to render a React component, start its name with an
uppercase letter.
3) Im Already using Pascal case "PieChart"
import PieChart from "../component/PieChart";
class App extends Component {
render() {
const GraphWidget = React.createElement("PieChart");
return (
<div>
{GraphWidget}
</div>
)
}
}
export default App;
PieChart, i.e.const GraphWidget = React.createElement(PieChart);