Better Environment Variables in React

preview_player
Показать описание
Get 🚀 Project React in my profile! #react #reactjs #reactjsdeveloper #programming #progammer #frontend #coding #code
Рекомендации по теме
Комментарии
Автор

One thing that comes with seniority is we stop importing silly packages. In this case it would be super sime to create same functionality your self, and big difference is that you can extend your functionality, change its behaviour and have no dependency.

mladenorsolic
Автор

Depending on how your component gets rendered, the value will be undefined.

engine_man
Автор

Awesome, love practical and production level work

irfansaeedkhan
Автор

That’s just an overkill to install a separate package for something as trivial as this. How about process.env.BASE_URL || ‘’

rahuldwivedi
Автор

Why not just set type? Sorry if i miss basic..but new at typescript

atharvabansod
Автор

Why not use a library that is more suitable for front end and tree-shakable? Valibot was designed with this in mind and can be a lot smaller in your bundle. Zod’s approach will always import all of the library

bob_kazamakis
Автор

How is it guareented if zod is only providing structure of env (i.e string)? What if i remove base url and just leave zod expecting string as base url even though it's not available?

elpeeda
Автор

Why not env.d.ts file where you can add types for your env

sivaganesh
Автор

env-cmd better way to create and use env variables

andriizhyvotovskyi
Автор

just use a well known and used "class-transform" and "class-validator". After creating an instance of ur custom Env Class, export it or make some sort of a dep-injection. Unfortunately, almost all the videos found on YT related to CSS and coding are either an absolute junk or are for total n00bies :(

quantum-t