react native refactor theme handling
I think what you are looking for is a ternary operator.
const configColors = (isSingle, isDarkMode) =&gt; {
  return {
      configAxisLabelColor : isDarkMode ? Colors.white : Colors.lineGray,
      configAxisGridColor : isDarkMode ? Colors.gridLineGray : Colors.transparent
      configAxisColor: isSingle ? (isDarkMode ? Colors.white: Colors.transparent) : Colors.lightBarGray
      // so on
  }

Another option that reads better could be to create a separate config for each possible combination you want to return.
const configColors = (isSingle, isDarkMode) =&gt; {

  const configSingleDark = {
    configAxisLabelColor : Colors.white,
    configAxisGridColor : Colors.gridLineGray
  }

  if (isSingle &amp;&amp; isDarkMode) {
    return configSingleDark
  } else if (isSingle &amp;&amp; !isDarkMode) {
    return configSingleLight
  } else {
    //
  }
}