It's Just JavaScript™️ ! (I should really make this our official tagline…)
Define your variables like any other module
// constant.js
const constants = {
primary: '#000',
lang: 'en'
}
export default constants
and then in your components just use that module
// Button.js
import constants from '../constants'
import styled from 'styled-components'
export default styled.button`
color: ${constants.primary};
`
No magic to be seen here!