Correct usage of dcc.Link (and other external resources) in a component

Hello :slight_smile:

i’m in the process of building my first dash component, a custom navigation. I’m using the dash-component-boilerplate for this. I’m a bit stumped on how i should import external resources into my component. E.g. When i click a link I don’t want the page to reload. I know link.react.js from dash_core_components is a perfect solution.

Do i need to copy the source code of this file into my src/ and import it from there? This will make the component bigger then it needs to be, since dash_core_components is used in the application anyway.

Some other examples:

  • fontawesome icons
  • react-router (Can this be used inside of a component only, not in the whole app?)

I’m looking forward to your answers

This is probably the safest option right now. The source code for that component is very small so I wouldn’t be too concerned about increasing the bundle size here.

1 Like