# React.js with typescript and prismic

**URL:** <https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168>\
**Category:** Developing with Prismic\
**Tags:** reactjs\
**Created:** [July 9, 2021, 9:42am UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168 "2021-07-09T09:42:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratha.arun](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@pratha.arun](https://community.prismic.io/u/pratha.arun)\
**Post date:** [July 9, 2021, 9:42am UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/1 "2021-07-09T09:42:47Z")

</div>

Hi Team,

I am trying to create website with create react app(typescript) and Prismic. My website will be more dynamic where the editors will manage(add/edit/delete) the pages/slices on prismic . Have few questions on that.

1. Do we have any prismic controls or npm modules available on react space to render the components.As I said my page is more dynamic, I do not want to iterate the json data and check each every fields of an object.
2. Can you share some source code / github link that have React+typescript stack for prismic

Thanks,  
Pratha

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [July 9, 2021, 2:49pm UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/3 "2021-07-09T14:49:05Z")

</div>

Hey @pratha.arun welcome to the Community

For the first topic, could you give me some more details about your project to understand your needs better?

Is it automatic re-building what you need to reload the new data coming from prismic? If that's so, you can use [Webhooks](https://prismic.io/docs/core-concepts/webhooks) and connect them to your deployment service

For typescript, The @prismicio/client and @prismicio/helpers already have support for typescript. You can checkout the examples for each kit to see how it's done

- [@prismicio/client examples](https://github.com/prismicio/prismic-javascript/tree/aa/v6/examples)
- [@prismicio/helpers examples](https://github.com/prismicio/prismic-helpers/tree/v2/examples)

---

<div class="post-metadata">

**Author:** ![pratha.arun](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@pratha.arun](https://community.prismic.io/u/pratha.arun)\
**Post date:** [July 12, 2021, 7:46am UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/4 "2021-07-12T07:46:26Z")

</div>

Thanks Paulina for your kind support.

I have few pages in my react web application that gets content from headless CMS. For Ex:  
My homepage have following sections and 90%of them are content manages

1. Banner section
2. 
  1. Product image carousal

3. Two column (text & Image) section

All the above sections are highly dynamic. The editor can have the ability to add extra text elements into banner. So when I create the banner component in react.js, should I add all the possible element of banner in my code? or is there anyway to simplify that?. I'm looking for a wrapper control that will render all the child elements of the banner. I believe the rich text npm module does the same for rich text component.

Can you share the prismic space details for one of the react example (prismic theme --theme-url [GitHub - prismicio/reactjs-website](https://github.com/prismicio/reactjs-website) --conf src/prismic-configuration.js)

Thanks,  
Pratha

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [July 16, 2021, 12:07pm UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/6 "2021-07-16T12:07:49Z")

</div>

Hi @pratha.arun,

Thanks for this information. I'm not sure I completely understand your use case, but I can make some suggestions.

There are a few ways to make dynamic content:

1. As you said, the [Rich Text field](https://prismic.io/docs/core-concepts/rich-text-title) is quite dynamic. If you use an [HTML Serializer](https://prismic.io/docs/core-concepts/html-serializer) with the Rich Text field, you can make the content highly customizable.
2. The Group field allows you to repeat content. So, you could create a Group field for your image carousel, and add images as needed.
3. [Slices](https://prismic.io/docs/core-concepts/slices) allow you to add and rearrange components in your content. You can add as many Slices as you want to a document. So, you could create a "Banner" Slice, an "Image Carousel" Slice, and a "Two Column" Slice. Each Slice includes an optional "Repeatable Zone," which acts just like the group field. Slices are the best way to create dynamic content in Prismic.

I hope that helps. Please let me know if you need more, or if I didn't answer your question.

Best,  
Sam

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [July 23, 2021, 11:43am UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/8 "2021-07-23T11:43:07Z")

</div>

This thread has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 3:35pm UTC](https://community.prismic.io/t/react-js-with-typescript-and-prismic/6168/9 "2021-12-09T15:35:54Z")

</div>


