All Projects โ†’ developit โ†’ proptypes

developit / proptypes

Licence: other
๐Ÿ’‚โ€โ™‚๏ธ React's PropTypes, as a standalone module.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to proptypes

rstpad
Standalone reStructuredText editor with live preview (native app)
Stars: โœญ 35 (-41.67%)
Mutual labels:  standalone
apps
daily.dev application suite
Stars: โœญ 253 (+321.67%)
Mutual labels:  preact
docker-spark
Apache Spark docker container image (Standalone mode)
Stars: โœญ 34 (-43.33%)
Mutual labels:  standalone
preact-polka-ssr
Preact SSR using Polka
Stars: โœญ 27 (-55%)
Mutual labels:  preact
hls-live-thumbnails
A service which will generate thumbnails from a live HLS stream.
Stars: โœญ 49 (-18.33%)
Mutual labels:  standalone
theodorusclarence.com
๐Ÿ’  Personal website and blog made using Next.js, TypeScript, Tailwind CSS, MDX Bundler, FaunaDB, and Preact.
Stars: โœญ 205 (+241.67%)
Mutual labels:  preact
not-only-mining-pool
new generation general mining pool in go
Stars: โœญ 31 (-48.33%)
Mutual labels:  standalone
preact-custom-scrollbars
โ‡… Preact scrollbars component
Stars: โœญ 20 (-66.67%)
Mutual labels:  preact
jasonformat.com
My blog
Stars: โœญ 18 (-70%)
Mutual labels:  preact
scala-js-preact
Scala.js facade for the Preact JavaScript library
Stars: โœญ 25 (-58.33%)
Mutual labels:  preact
jsxt
The collection of Javascript / JScript / VBScript extensions, tools and more
Stars: โœญ 23 (-61.67%)
Mutual labels:  standalone
desvg
๐ŸŒ… Converts SVG files into components ๐ŸŒž
Stars: โœญ 79 (+31.67%)
Mutual labels:  preact
observable-to-standalone
Importing an Observable notebook into a standalone application
Stars: โœญ 31 (-48.33%)
Mutual labels:  standalone
stoxy
Stoxy is a state management API for all modern Web Technologies
Stars: โœญ 73 (+21.67%)
Mutual labels:  preact
preact-component-console
A console emulator for preact.
Stars: โœญ 29 (-51.67%)
Mutual labels:  preact
preact-urql
Preact bindings for urql
Stars: โœญ 28 (-53.33%)
Mutual labels:  preact
preact-server-renderer
Server side rendering of preact components
Stars: โœญ 66 (+10%)
Mutual labels:  preact
TwitterPiBot
A Python based bot for Raspberry Pi that grabs tweets with a specific hashtag and reads them out loud.
Stars: โœญ 85 (+41.67%)
Mutual labels:  standalone
preact-delegate
Preact delegate DOM events
Stars: โœญ 17 (-71.67%)
Mutual labels:  preact
you-get.exe
You-Get unofficial build executable for Windows || You-Get ้žๅฎ˜ๆ–นๆž„ๅปบ็š„ๅฏๆ‰ง่กŒๆ–‡ไปถ
Stars: โœญ 40 (-33.33%)
Mutual labels:  standalone

proptypes

React's PropTypes, packaged up as a standalone module.

DISCLAIMER: This is literally copied from the React 0.14 codebase. If you're using PropTypes with React, it would be silly to reference this standalone version.

Usage

function check(props, propTypes) {
  for (let prop in propTypes) {
    if (propTypes.hasOwnProperty(prop)) {
      let err = propTypes[prop](props, prop, 'name', 'prop');
      if (err) {
        console.warn(err);
        return false;
      }
    }
  }
  return true;
}

let valid = check({
  a: 42,
  b: 'News'
}, {
  a: PropTypes.number,
  b: PropTypes.oneOf(['News', 'Photos'])
});

valid;  // true

Production build

Disabling

With webpack:

module.exports = {
  resolve: {
    alias: {
      proptypes: 'proptypes/disabled',
    }
  }
};

Removing the definitions with React

When you are using this package with React like API, you might want to save bandwidth by removing the definitions. You can use babel-plugin-transform-react-remove-prop-types for that use case, for instance:

// In
const Baz = (props) => (
  <div {...props} />
);

Baz.propTypes = {
  className: PropTypes.string
};

// Out
const Baz = (props) => (
  <div {...props} />
);

License

BSD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].