-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from expatfile/@HofmannZ/fix/server-components
App Directory Support
- Loading branch information
Showing
63 changed files
with
2,300 additions
and
4,840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Exposing custom environment variables 🛠 | ||
|
||
You might not only want to expose environment variables that are prefixed with `NEXT_PUBLIC_`. In this case you can use the `EnvProvider` to expose custom environment variables to the context. | ||
|
||
## Example | ||
|
||
```tsx | ||
// app/layout.tsx | ||
|
||
import { EnvProvider } from 'next-runtime-env'; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
<EnvProvider | ||
env={{ | ||
NEXT_PUBLIC_: process.env.NEXT_PUBLIC_FOO, | ||
BAR: process.env.BAR, | ||
BAZ: process.env.BAZ, | ||
notAnEnvVar: 'not-an-env-var', | ||
}} | ||
> | ||
{children} | ||
</EnvProvider> | ||
</body> | ||
</html> | ||
); | ||
} | ||
|
||
// By default server components are statically generated at build-time. To make | ||
// sure the env vars are actually loaded use, add the following line to server | ||
// components that use [env]. 👇 | ||
export const dynamic = 'force-dynamic'; | ||
``` |
Oops, something went wrong.