How to use the metal-jsx.Config.oneOf function in metal-jsx

To help you get started, we’ve selected a few metal-jsx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metal / metal-devtools / frontend / components / NodeName.js View on Github external
return (
      <span class="node-name-container">
        {type === NORMAL_CLOSING ? '{name}</span>

        {type === SELF_CLOSING ? ' /&gt;' : '&gt;'}
      
    );
  }
}

NodeName.PROPS = {
  name: Config.string(),
  type: Config.oneOf([OPENING, NORMAL_CLOSING, SELF_CLOSING]).value(OPENING)
};

export default NodeName;
github metal / metal-devtools / frontend / components / App.js View on Github external
setStateFn={setStateFn}
          typeColors={theme === 'dark' ? DARK_TYPE_COLORS : undefined}
        /&gt;
      
    );
  }
}

App.PROPS = {
  highlightDOM: Config.func(),
  inspectDOM: Config.func(),
  onComponentExpand: Config.func(),
  onSelectedChange: Config.func(),
  port: Config.any(),
  setStateFn: Config.func(),
  theme: Config.oneOf(['dark', 'light']).value('light')
};

App.STATE = {
  firstColumnWidth: Config.number(),
  freezeUpdates: Config.value(false),
  rootComponents: Config.value({}),
  selectedComponent: Config.value({})
};

export default App;

metal-jsx

A JSX templates renderer to be used with Metal.js's Component class

BSD
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis