UNPKG

styled-components

Version:

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅

17 lines (12 loc) • 539 B
"use strict"; exports.__esModule = true; exports.default = function (props, fallbackTheme, defaultProps) { // Props should take precedence over ThemeProvider, which should take precedence over // defaultProps, but React automatically puts defaultProps on props. /* eslint-disable react/prop-types */ var isDefaultTheme = defaultProps && props.theme === defaultProps.theme; var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme; /* eslint-enable */ return theme; }; module.exports = exports["default"];