# using reactflow in an app

**URL:** <https://community.dynatrace.com/t/using-reactflow-in-an-app/42339>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app\
**Created:** [October 28, 2023, 10:03am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339 "2023-10-28T10:03:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 28, 2023, 10:03am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/1 "2023-10-28T10:03:55Z")

</div>

Hi,

On the webinar A Practitioners Guide to "Dynatrace AppEngine: Everything thinkable is now possible ([https://www.youtube.com/watch?v=D5SDmLx6Aj4](https://www.youtube.com/watch?v=D5SDmLx6Aj4)) It was shown how to use reactflow in an app.

I’m trying to utilize this library as well and even on static data from the getting started tutorial they provide I don’t get the flow being written. As I saw it working on the webinar, i have no doubt I’m doing something wrong but can’t really find what.

Has anyone integrated reactflow into an app?

This is my simple app code:

```javascript
import React from 'react';
import ReactFlow, {
  MiniMap,
  Controls,
  Background,
  useNodesState,
  useEdgesState,
  BackgroundVariant,
} from 'reactflow';

import 'reactflow/dist/style.css';

const initialNodes = [
  { id: '1', position: { x: 0, y: 0 }, data: { label: '11' } },
  { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
];
const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];
export const App = () => {
  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);

  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <ReactFlow
        nodes={nodes}
        edges={edges}
        onNodesChange={onNodesChange}
        onEdgesChange={onEdgesChange}
        attributionPosition='top-right'
        fitView
>
        <Background variant={BackgroundVariant.Dots} />
      </ReactFlow>
    </div>
  );
}

```

and this is the result I see:

 ![gilgi_0-1698487353612.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/f/5f46fa436cdb1dc536ff41e54194256c302e969b.png)

[@andreas\_grabner](https://community.dynatrace.com/user/146)&nbsp;did you publish the resulting code of the webinar somewhere?

Gil.

---

<div class="post-metadata">

**Author:** ![andreas\_grabner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andreas_grabner/32/27879_2.png) [@andreas\_grabner](https://community.dynatrace.com/u/andreas_grabner)\
**Post date:** [October 28, 2023, 10:39am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/2 "2023-10-28T10:39:38Z")

</div>

Hi. The technical demo was done by&nbsp;[@dirk\_wall](https://community.dynatrace.com/user/11848)&nbsp;- maybe he can share his code from back then.

For more guidance and examples you could also reach out to the Dynatrace Platform Advocacy Team, e.g:&nbsp;[@sinisa\_zubic](https://community.dynatrace.com/user/38283)&nbsp;or&nbsp;[@Inder](https://community.dynatrace.com/user/47210)

---

<div class="post-metadata">

**Author:** ![stefan\_eggersto](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_eggersto/32/34114_2.png) [@stefan\_eggersto](https://community.dynatrace.com/u/stefan_eggersto)\
**Post date:** [October 30, 2023, 6:31am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/3 "2023-10-30T06:31:26Z")

</div>

Hi&nbsp;[@gilgi](https://community.dynatrace.com/user/12008)&nbsp;,

there were recently some issues in the Dynatrace App Toolkit about injecting stylesheets, see&nbsp;[Dynatrace App Toolkit changelog | Dynatrace Developer](https://developer.dynatrace.com/whats-new/release-notes/app-toolkit/)

The version 0.107.3 should have this fixed. Can you please ensure you have the latest version (just run `npx dt-app update`)? Let me know if you still observe this issue with the latest version.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [November 1, 2023, 2:28pm UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/4 "2023-11-01T14:28:48Z")

</div>

Hi&nbsp;[@stefan\_eggersto](https://community.dynatrace.com/user/9516)&nbsp;, not sure what happened but it started to work suddenly. Thanks.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [November 30, 2023, 9:38pm UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/5 "2023-11-30T21:38:03Z")

</div>

[@dirk\_wall](https://community.dynatrace.com/user/11848)&nbsp;[@stefan\_eggersto](https://community.dynatrace.com/user/9516)&nbsp;,

Coming back to this question. When deploying the app (and not working with the local server) I’m getting this vehavior of not being able to load the css of reactflow and have it enabled. I’m using version 0.109 of the app tool kit. Any ideas?

Gil.

---

<div class="post-metadata">

**Author:** ![stefan\_eggersto](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_eggersto/32/34114_2.png) [@stefan\_eggersto](https://community.dynatrace.com/u/stefan_eggersto)\
**Post date:** [December 1, 2023, 8:35am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/6 "2023-12-01T08:35:25Z")

</div>

Hi&nbsp;[@gilgi](https://community.dynatrace.com/user/12008),

I just tried the above code, and it works for me with dt-app 0.109.0, both in the local development environment and deployed.

I currently only know about one issue with CSS injection, and this happens when you change the entry point for `main.tsx` to something different (see&nbsp;[https://developer.dynatrace.com/reference/app-toolkit/configuration/#build-options](https://developer.dynatrace.com/reference/app-toolkit/configuration/#build-options), option `build.ui.entryPoint`).

I attached my app code (without the app config file). Can you please try this or compare if there are any obvious differences to your code?  
[react-flow.zip](https://community.dynatrace.com/uploads/short-url/3YX8VmsCvGK7syyyMXbaHqxavi3.zip) (1.47 KB)

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [December 1, 2023, 11:54am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/7 "2023-12-01T11:54:02Z")

</div>

Hi [@stefan\_eggersto](https://community.dynatrace.com/user/9516)&nbsp;,

Just tried it and it acts the same as mine. on local development server everything is fine. When deployed It seems like the CSS is not loaded or something like that.

Gil.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [December 2, 2023, 6:04am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/8 "2023-12-02T06:04:46Z")

</div>

Hi&nbsp;[@stefan\_eggersto](https://community.dynatrace.com/user/9516)&nbsp;,

I’ve figured out what the problem is. When deployed, the css files are not loaded/not deployed (don’t see the css file being called even on dev tools when accessing the page).

To prove that I’ve created my own test css file and referenced it from a page. Worked on my local dev server, but when deployed - the same symptom as with reactflow.

So the real question: is there anything specific within the configuration files that needs to be done in order to include css files?

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [December 4, 2023, 9:41am UTC](https://community.dynatrace.com/t/using-reactflow-in-an-app/42339/9 "2023-12-04T09:41:52Z")

</div>

[@gilgi](https://community.dynatrace.com/user/12008)&nbsp;I can confirm that this is a bug on windows. I’ve reported it to responsible team and it will be fixed asap. Thanks for reporting it 🙂
