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
.shadow-neumorphic { | |
@apply shadow-[5px_5px_30px_rgba(190,190,190,0.15),-5px_-5px_30px_rgba(255,255,255,0.15)]; | |
} | |
.flex-center { | |
@apply flex items-center justify-center; | |
} | |
.flex-between { | |
@apply flex items-center justify-between; |
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
const nextConfig = { | |
//... | |
modularizeImports: { | |
'react-icons/?(((\\w*)?/?)*)': { | |
transform: '@react-icons/all-files/{{ matches.[1] }}/{{ member }}', | |
skipDefaultConversion: true, | |
}, | |
}, | |
//... | |
} |
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
//Correct way of creating hooks as a facade layer | |
export const useSettings = () => { | |
const settings = useStore((state) => state.settings) | |
const setSettings = useStore((state) => state.setSettings) | |
return { settings, setSettings } | |
} | |
//Incorrect way of creating a hook: this causes the zustand state to subscribte to the whole store, which is not necessary. | |
//It compares OBJECT to OBJECT, which will always be different (as Objects are compared by the memory address). | |
//Returning functions one by one like in the first hook is correct, as it does not cause the whole store to be subscribed. |
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
{ | |
foo: 'bar' | |
} |