# Using Svelte instead of React

**URL:** <https://forum.canton.network/t/using-svelte-instead-of-react/3407>\
**Category:** App Development\
**Created:** [November 3, 2021, 1:26pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407 "2021-11-03T13:26:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [November 3, 2021, 1:26pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/1 "2021-11-03T13:26:19Z")

</div>

Going thru the cert training, and docs in general, I see that the recommended frontend stack is to use React but I much rather use Svelte, which is where our organization has moved to, so I’m wondering how much going against the grain friction will I encounter ?

your feedback is much appreciated,

-Charles

---

<div class="post-metadata">

**Author:** ![drsk](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/drsk/32/43_2.png) [@drsk](https://forum.canton.network/u/drsk)\
**Post date:** [November 3, 2021, 3:28pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/2 "2021-11-03T15:28:31Z")

</div>

I don’t have any experience with Svelte, but from looking at the docs I think you will be fine by using the other two provided JavaScript libraries `daml/types` and `daml/ledger`. I suggest you take a look at [daml/ledger](https://www.npmjs.com/package/@daml/ledger) and then decide how much work it would be to use Svelte together with `daml/ledger` to access the ledger.

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [November 3, 2021, 3:52pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/3 "2021-11-03T15:52:14Z")

</div>

thank you , just a follow up, isn’t it possible from any UI library to interact with the daml ledger via a REST json/http API ? which it seems you provide, if so are there any disadvantages to following that route vis a vis interacting directly with the JS daml/ledger API

thanks

-Charles

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 4, 2021, 9:15am UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/4 "2021-11-04T09:15:26Z")

</div>

You can definitely create the requests yourself as well. The advantage of using the typescript codegen & `@daml/ledger` is that they generate you a library that is specific to your Daml model which provides a very convenient API (and if you use typescript, a statically typed one) for interacting with your model. If you do things without that, you just have to do a bit more of the heavy lifting yourself and assemble the requests payload correctly.

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [November 4, 2021, 12:48pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/5 "2021-11-04T12:48:41Z")

</div>

thanks,

but it seems that is not necessarily just specific to the react libraries i.e. given what you are saying connecting my svelte UIs to the api generated by the typescript codegen , daml/ledger is viable.

What I still have to get my head around is that in the context of hooking up to our enterprise application it would seem that a microservice coordinating the interaction of our application with the ledger is a better approach and in that case it would be about codegen java bindings (others were deprecated) based on the specified models , therefore we would have UIs communicating with the microservice and most probably over json/https.

If that’s the approach then my question is irrelevant i.e. its really about using daml syntax to build my models , then codegen to generate API and that would be Java codegen, my microservice would expose a json/https based API to our pre-existing application for the passing of business events which would be used to update contract state on the ledger

Am I missing something ?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 4, 2021, 1:12pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/6 "2021-11-04T13:12:25Z")

</div>

The microservice approach using the Java bindings is definitely also a reasonable option especially if you want to decouple your UI somewhat from your daml models.

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [November 10, 2021, 1:43pm UTC](https://forum.canton.network/t/using-svelte-instead-of-react/3407/7 "2021-11-10T13:43:05Z")

</div>

ok, thanks
