Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
13 lines
503 B
Plaintext
13 lines
503 B
Plaintext
import getDefaultNow from '../server/react-server/getDefaultNow.js';
|
|
import useConfig from './useConfig.js';
|
|
|
|
function useNow(options) {
|
|
if (options?.updateInterval != null) {
|
|
console.error("`useNow` doesn't support the `updateInterval` option in Server Components, the value will be ignored. If you need the value to update, you can convert the component to a Client Component.");
|
|
}
|
|
const config = useConfig('useNow');
|
|
return config.now ?? getDefaultNow();
|
|
}
|
|
|
|
export { useNow as default };
|