Skip to content

Commit

Permalink
Set the style tag next to the picker
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Feb 1, 2024
1 parent 5d891e9 commit 952c250
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.7.10",
"version": "4.7.11",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -98,6 +98,6 @@
"rollup-plugin-svg": "^2.0.0"
},
"dependencies": {
"flairup": "0.0.35"
"flairup": "0.0.37"
}
}
13 changes: 3 additions & 10 deletions src/Stylesheet/stylesheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { Styles, createSheet } from 'flairup';
import * as React from 'react';

import { ClassNames } from '../DomUtils/classNames';
import { useIsEverMounted } from '../hooks/useIsEverMounted';

export const stylesheet = createSheet('epr');
export const stylesheet = createSheet('epr', null);

const hidden = {
display: 'none',
Expand All @@ -21,20 +20,14 @@ export const commonStyles = stylesheet.create({
}
});

export function PickerStyleTag() {
const isMounted = useIsEverMounted();

if (stylesheet.isApplied() && isMounted) {
return null;
}

export const PickerStyleTag = React.memo(function PickerStyleTag() {
return (
<style
suppressHydrationWarning
dangerouslySetInnerHTML={{ __html: stylesheet.getStyle() }}
/>
);
}
});

export const commonInteractionStyles = stylesheet.create({
'.epr-main': {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6798,10 +6798,10 @@ find-up@^5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"

[email protected].35:
version "0.0.35"
resolved "https://registry.yarnpkg.com/flairup/-/flairup-0.0.35.tgz#d14abb36e823e8e5091574049417d8ea758a7c4e"
integrity sha512-nXDgTr2WT7UT7HJnNRHRnbo93xs5B3ar5lRWqIbJ6hiwWTSIex5xp56uhEzow6+S5hySoX0mEhzYbLtU3K3A+A==
[email protected].37:
version "0.0.37"
resolved "https://registry.yarnpkg.com/flairup/-/flairup-0.0.37.tgz#5a3c64a7a25d826d520a280def14fca672ffce66"
integrity sha512-GY7coNGpJQczEIfBsgByKhkclQZC2OosDyyGTfFfm2rXEzwq7MbWQgGo/GwM7TdU53Ow4rPznKPMC8Q3iympjQ==

flat-cache@^2.0.1:
version "2.0.1"
Expand Down

0 comments on commit 952c250

Please sign in to comment.