# Adding custom components in header not working as expected

**URL:** <https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134>\
**Category:** Bug Reports\
**Tags:** pdfjs-express\
**Created:** [February 15, 2024, 4:34pm UTC](https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134 "2024-02-15T16:34:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![achandran](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@achandran](https://pdfjs.community/u/achandran)\
**Post date:** [February 15, 2024, 4:34pm UTC](https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134/1 "2024-02-15T16:34:44Z")

</div>

Hi Team am trying to add custom components on header like what mentioned in documentation.  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/f/fb5e989ac6dad1e70057a35a2154dfe31dd28219.png)

but whenever I use useState or useEffect on my custom component it resulting in following error

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/4/44f576c465edb4e32c140b0726dd7770743f0632.png)

Please help me to resolve this

---

<div class="post-metadata">

**Author:** ![ejohnson](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@ejohnson](https://pdfjs.community/u/ejohnson)\
**Post date:** [February 15, 2024, 8:51pm UTC](https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134/3 "2024-02-15T20:51:43Z")

</div>

Thank you for posting the incident to our forum. We will provide you with an update as soon as possible.

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [February 15, 2024, 10:27pm UTC](https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134/4 "2024-02-15T22:27:27Z")

</div>

Hello achandran,

This does not look like it is related to PDFJS Express. If it is, please provide additional information!

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![achandran](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@achandran](https://pdfjs.community/u/achandran)\
**Post date:** [February 16, 2024, 6:23am UTC](https://pdfjs.community/t/adding-custom-components-in-header-not-working-as-expected/3134/5 "2024-02-16T06:23:39Z")

</div>

![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/d/d1c33d832cf786c350dd33fe96098ce84cc83a5c.png)  
Pleas take a look at this,  
in slider component if am using any hooks(useState, useEffect) an getting that error, if I remove hooks there wont be any errors
