compiled icon indicating copy to clipboard operation
compiled copied to clipboard

Expose ax function in class names props

Open itsdouges opened this issue 5 years ago • 0 comments

Currently if you want to access ax you need to import it directly:

import { ax } from '@compiled/react/runtime';

We don't want to encourage developers accessing the runtime module if we can avoid it. Instead ax should be supplied through the ClassNames props:

<ClassNames>{({ ax }) => <div className={ax([])} />}</ClassNames>

This handles the use case where developers using ClassNames want to also take styles as props and compose them together.

itsdouges avatar Nov 18 '20 05:11 itsdouges