Build a Component Library for React with Typescript [2021]

Build a Component Library for React with Typescript [2021]

The Nerdy Canuck

2 года назад

24,561 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Vishwas Vishu
Vishwas Vishu - 27.09.2023 17:40

How to add ref for the components that we are created??

Ответить
Brychan
Brychan - 03.08.2023 19:52

If I want to use tailwindcss both in my component library and in the projects that are consuming it, how do I do that?

Ответить
Anirban Samaddar
Anirban Samaddar - 29.07.2023 05:59

Hello I don't know if anyone is going to reply to me or not but hoping they would I'm posting my comment. I'm using npm init the same process but what I'm trying to make contains mui card components. Now, I have written webpack config file ts config file in the root folder have exported all files in index.ts named entry point file , but still when i pack it says "interface" and "type" keyword is not recognised. I tried writing babel.config to fix this problem but it just excluded all the node modules that way and it became another problem overall. any suggestions on what to do when basic typescript keywords are not accepted. I even used babel loader and included all files in resolve part like ts and tsx and jsx.

Ответить
Phi Youtube
Phi Youtube - 24.05.2023 04:57

can we use a Button from @mui/material/Button in this component library ?

Ответить
ovshar
ovshar - 06.05.2023 13:53

i cant use this in windows:(

Ответить
Daniel Gunther
Daniel Gunther - 21.03.2023 01:49

Really great video. Thanks so much.

Ответить
Ravi Tandon
Ravi Tandon - 09.03.2023 11:24

Thank you! Well done!

Ответить
Prathap Reddy
Prathap Reddy - 22.02.2023 08:45

How do we compile assests, css/scss?

Ответить
Nazar Kravchenko
Nazar Kravchenko - 17.01.2023 16:50

thank you

Ответить
Igor Carvalho de Paula
Igor Carvalho de Paula - 02.11.2022 03:19

and add taiwind there?

Ответить
Minecraftzocker766
Minecraftzocker766 - 28.10.2022 09:31

Many thanks for this great tutorial! 🙏🏼

Ответить
Charles Forsyth
Charles Forsyth - 17.10.2022 03:38

Would putting the react and react-dom in "peerDependencies" of the component library solve the problem of hooks you mentioned?

Ответить
SOMHRIK KONAR
SOMHRIK KONAR - 29.09.2022 20:42

hey, any update on how to use scss modules (style.module.scss)

Ответить
aalhommada
aalhommada - 22.09.2022 15:34

Thanks a lot ,

Ответить
Nees Web Services
Nees Web Services - 10.09.2022 23:04

How can we add MIT licence in it ?

Ответить
Irtaza Hussain
Irtaza Hussain - 30.08.2022 19:28

I am on windows and whenever I try to run the build command it shows an error in the terminal.

F:\Button>npm run build

> [email protected] build
> rm -rf dist/ && prettier --write src/ && npm run build:esm && npm run build:cjs

'rm' is not recognized as an internal or external command,
operable program or batch file.

Will wait for your kind response.
PS: I also used the del /s /q but after that i got another error

F:\Button>npm run build

> [email protected] build
> del /s /q -rf dist/ && prettier --write src/ && npm run build:esm && npm run build:cjs

Invalid switch - "".

F:\Button>

Ответить
Sumit Wadhwa
Sumit Wadhwa - 21.08.2022 14:09

Excellent video. Thanks for sharing.

Ответить
Stanley Festus
Stanley Festus - 17.08.2022 07:09

Great video! I really thought rollup or webpack is a must. I have a problem though. I am publishing to npm with git but have error about using useState hooks. How can I fix this?

Ответить
Kamal kamal
Kamal kamal - 02.08.2022 09:12

that s not good u need to add watch update on ur package because it s stupid run build every time u change any thing

Ответить
Ankit Mehrotra
Ankit Mehrotra - 04.05.2022 01:16

Excellent tutorial. Learned a lot from it. Subscribed...:)

Ответить
raj shah
raj shah - 20.04.2022 23:11

Can you please tell me how can i add css or scss files?

Ответить
Luca Ford
Luca Ford - 11.04.2022 19:28

This video is perfect.
Recommended 100%. You don't even realize how many issues you avoid only by following this steps.

Ответить
Scratch Coding
Scratch Coding - 23.02.2022 17:40

This is called a tutorial man!!!

Ответить
manu drlng
manu drlng - 15.02.2022 15:43

when i am trying to use some image's and svg's its saying that webpackmodule missing, and if am using this className={classes.someClass} getting output just like this class=[object object] in another project can you help on this please

Ответить
manu drlng
manu drlng - 14.02.2022 08:55

Thanks buddy, it was very helpful. 👍

Ответить
Zlatko Iliev
Zlatko Iliev - 06.02.2022 12:13

Great tutorial mate! Can you also show how can we add icons and tailwindcss, I guess we will need webpack for that?!? Also a storybook will be great to have too!

Ответить
Karl Krasnowsky
Karl Krasnowsky - 02.02.2022 01:35

So close! This is by far the most straight forward approach to library creation, especially given a smaller sized library.
After building a library using this approach, however, I found that I'm in need of including stylesheet (css) files in my component imports and the build as provided in this tutorial doesn't bundle them.
Any hints on how I might be able to do this without resorting to a full rollup bundler?

Ответить
Tony Martin
Tony Martin - 17.01.2022 19:15

Please also show how to publish the package

Ответить
CHARAN SRINIVAS
CHARAN SRINIVAS - 30.12.2021 18:32

What about css files it wont get copied or transpiled or compiled . Is there any solution for this?

Ответить
TVRT Kraven
TVRT Kraven - 28.12.2021 14:11

Omg what a great video. I watched this now I am hacking the Pentagon!

Ответить
john mark
john mark - 28.12.2021 09:31

That's great man, i appreciate your work. Keep it up!

Ответить
IgDzTV
IgDzTV - 28.12.2021 05:13

Really appreciate this!

Ответить
Paulv
Paulv - 27.12.2021 08:07

Thanks mate! Another great tutorial 🔥

Ответить