react-spinners icon indicating copy to clipboard operation
react-spinners copied to clipboard

Support CSP nonce

Open sdemjanenko opened this issue 1 year ago • 2 comments

I am running in to an issue with the inline styles that this library is injecting: https://github.com/davidhu2000/react-spinners/blob/6f6d0f8b5d5f7ee2ea217682c227f2af77de73b1/src/helpers/animation.ts#L9. This could be fixed by exposing a Provider which can then receive a nonce to use for the inline style injection. See emotion's solution for this: https://emotion.sh/docs/@emotion/cache#nonce.

Im not sure if animations are the only place in the codebase that inject inline styles. All places would need to be updated to use a provided nonce.

sdemjanenko avatar Jul 02 '24 21:07 sdemjanenko

Hi @sdemjanenko , did you manage to resolve your issue?

To date, nonce is still not supported right?

TommyLeong avatar Jul 17 '25 06:07 TommyLeong

@TommyLeong I did not resolve the issue. Nonce is still not supported. It wouldn't be too hard to make a PR for it, but I never got around to it. It could to done with an approach similar to https://emotion.sh/docs/@emotion/cache

sdemjanenko avatar Jul 17 '25 19:07 sdemjanenko