Silind-Software / direflow

🧩 Use the best of two worlds. Create fast, performant, native Web Components using React.
https://direflow.io
MIT License
501 stars 77 forks source link

How to set the external-loader dynamic using the direflow properties that we get. #260

Open mohiddin21 opened 2 years ago

mohiddin21 commented 2 years ago

Hi All,

I have a requirement where I need to load the external-loader dynamic using direflow properties.

Here is the sample code: const direflowProperties = { dynamicurl: '', };

export default DireflowComponent.create({ component: AppData, configuration: { tagname: "sample-comp", useShadow: true, }, properties: direflowProperties, plugins: [ { name: 'external-loader', options: { paths: [ { src: ${direflowProperties.dynamicurl}src.f69400ca.css, async: true, useHead: true } ], } } ] });

In the above sample code, value for dynamicurl property is available in the AppData component when the web component gets loaded, where as in direflow creation component its not. Please suggest on how to load dynamic external-loader url.

I even tried with useExternalSource hook but no luck.