javascripthtmlcssreactjsantd

How to display ant design flow chart? Can you help me?


I'm working with ant design chart, specifically is flow chart of it. I use the basic code on this: "https://charts.ant.design/en/examples/flowchart/basic#basic". But I have a problem is I can not render the flow chart as the example. Do you know how to display it? Can you help me with this. Thank you very much!

This is the code sandbox link for this, but on code sandbox it is not display too. https://codesandbox.io/s/misty-forest-uz2xrf


Solution

  • It is not displaying because of missing dependencies. Add @ant-design/icons and antd as an dependency after that it will display.

    We will also need to import the necessary css file also, without it the flowchart widgets will be unresponsive and disproportionate. You can add css file by adding this line. import '@ant-design/flowchart/dist/index.css';

    As of now, It does not work with React.StrictMode. So remove it.