-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hey there — such a great tool for making text more visually appealing online.
I have used this in non-React based sites but am struggling to get it to work within React/NextJS/Gatsby based sites.
In Next I have tried this in my _app.js:
<Script src='/balancetext.js' strategy='beforeInteractive' />
<Script
id='balance-text-script'
strategy='afterInteractive'
dangerouslySetInnerHTML={{
__html: `
balanceText();
`,
}}
/>
and I have also tried this in my pages:
import * as balanceText from "balance-text";
...
useEffect(() => {
balanceText();
return () => {};
}, []);
But none of these appear to work, even with the above, if I visit my site in browser and do balanceText(); in console, it picks up the command but isn't applied to any text that has the balance-text class, just gets completely ignored, any ideas?
nuthinking
Metadata
Metadata
Assignees
Labels
No labels