Hi,
I'm using xstyled for my project and keen on using some utils like centerAlign, clearFix etc to be used as props on x elements as
<x.div centerAlign clearfix ....
I'm using it in a TS project and following this guide https://xstyled.dev/docs/adding-new-utilities/
and https://xstyled.dev/docs/typescript/
It says to create the xstyled.config.js but what to do with it I'm not sure. I created it in the project root but it doesn't seem to work. Also, TS is not able to identify the custom prop of centerAlign added. The TS guide only talks about custom theme types.
π¬ Questions and Help
Hi, I'm using xstyled for my project and keen on using some utils like
centerAlign
,clearFix
etc to be used as props on x elements as<x.div centerAlign clearfix ....
I'm using it in a TS project and following this guide https://xstyled.dev/docs/adding-new-utilities/ and https://xstyled.dev/docs/typescript/ It says to create the xstyled.config.js but what to do with it I'm not sure. I created it in the project root but it doesn't seem to work. Also, TS is not able to identify the custom prop of
centerAlign
added. The TS guide only talks about custom theme types.Below is my xstyled.cutom.js looks like.
So, a complete guide or a sandbox would be great. Here's a sandbox https://codesandbox.io/p/sandbox/xstyled-v2-playground-forked-q7dy59