This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import React from 'react'; | |
| export const createComponent = (rule, type = 'div', opts = {}) => { | |
| const { omitProps = [] } = opts; | |
| const FelaComponent = ({ children, className, injectRule, ...other }, { renderer, theme }) => { | |
| let componentProps = other; | |
| if (omitProps.length) { | |
| componentProps = {}; | |
| const blacklist = new Set(omitProps); // Todo make performance test to evaluate if sets are faster | |
| Object.keys(other).forEach(key => { if (!blacklist.has(key)) componentProps[key] = other[key]; }); |