Skip to content

Commit

Permalink
fix type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Assem-Uber committed Feb 18, 2024
1 parent b0ff426 commit 7b92133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/StyletronProviderWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use client';
import React from "react";
import { Provider as StyletronProvider } from "styletron-react";
import { ThemeProvider } from "baseui/styles";
import { DarkTheme } from "baseui/themes";
import { styletron } from "../styletron";

export default function StyletronProviderWrapper({ children }) {
export default function StyletronProviderWrapper({ children }: { children: React.ReactNode }) {
return (
<StyletronProvider value={styletron}>
<ThemeProvider theme={DarkTheme}>
Expand Down
3 changes: 2 additions & 1 deletion src/app/registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import React, { useRef } from 'react'
import { useServerInsertedHTML } from 'next/navigation'
import { styletron, } from '@/styletron';
import { Server } from 'styletron-engine-monolithic';

export default function StyledJsxRegistry() {
const isServerInserted = useRef(false);
useServerInsertedHTML(() => {
if (!isServerInserted.current) {
isServerInserted.current = true;
const stylesheets = styletron.getStylesheets();
const stylesheets = (styletron as Server).getStylesheets();
return <>{stylesheets.map((sheet, i) => (
<style
key={i}
Expand Down

0 comments on commit 7b92133

Please sign in to comment.