DEV Community

Sri Charan Thiruvalluru
Sri Charan Thiruvalluru

Posted on

How to use two NPM packages for single HTML tag???

Assume we're having a div tag, which looks like this :

<div>Welcome to Youtube : https://www.youtube.com/ #youtube </div>
Enter fullscreen mode Exit fullscreen mode

I want to use two npm packages for this tag.
One is react-linkify which is used to make links in a div clickable.
Other one is react-highlight-hashtags which is used to highlight hastags.

Now I want to use these two packages on above div. When I tried to make nested tags like this :

<Linkify>
    <Hashtags> 
         <div>Welcome to Youtube : https://www.youtube.com/ #youtube </div>
    </Hashtags>
</Linkify>
Enter fullscreen mode Exit fullscreen mode

I'm getting some errors. How to achieve this ???

Thanks in advance.

Top comments (0)