-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include zustand on framer build using 'commonjsPlugin'
- Loading branch information
Showing
6 changed files
with
124 additions
and
5 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
40 changes: 40 additions & 0 deletions
40
packages/shadergradient-v2/src/ShaderGradientStateless/ShaderGradientStatelessCanvas.tsx
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,40 @@ | ||
import { useEffect } from 'react' | ||
import { Canvas } from '@react-three/fiber' | ||
import { canvasProps } from '@/consts' | ||
import * as THREE from 'three' | ||
|
||
export function ShaderGradientStatelessCanvas({ | ||
children, | ||
style = {}, | ||
pixelDensity = 1, | ||
fov = 45, | ||
pointerEvents, | ||
}: { | ||
children: React.ReactNode | ||
style?: React.CSSProperties | ||
pixelDensity?: number | ||
fov?: number | ||
pointerEvents?: 'none' | 'auto' | ||
}): JSX.Element { | ||
useShaderChunkFix() | ||
|
||
return ( | ||
<Canvas | ||
style={{ ...style, pointerEvents }} | ||
resize={{ offsetSize: true }} | ||
{...canvasProps(pixelDensity, fov)} | ||
> | ||
{children} | ||
</Canvas> | ||
) | ||
} | ||
|
||
function useShaderChunkFix() { | ||
useEffect(() => { | ||
// Fix Error: Can not resolve #include <uv2_pars_vertex>, <... (it is needed from three.js version 0.151.3) | ||
THREE.ShaderChunk['uv2_pars_vertex'] = `` | ||
THREE.ShaderChunk['uv2_vertex'] = `` | ||
THREE.ShaderChunk['uv2_pars_fragment'] = `` | ||
THREE.ShaderChunk['encodings_fragment'] = `` | ||
}, []) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/shadergradient-v2/src/ShaderGradientStateless/index.ts
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './store/useQueryState' | ||
export * from './ShaderGradientStateless' | ||
export * from './ShaderGradientStatelessCanvas' |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.