{"id":21823885,"url":"https://github.com/nguyenchr/strummer-prop-types","last_synced_at":"2026-05-21T07:18:45.717Z","repository":{"id":57372981,"uuid":"109253043","full_name":"nguyenchr/strummer-prop-types","owner":"nguyenchr","description":"Use strummer schemas as react prop types","archived":false,"fork":false,"pushed_at":"2017-11-02T11:28:17.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T14:29:25.352Z","etag":null,"topics":["proptypes","react","strummer","validation"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nguyenchr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-02T10:57:33.000Z","updated_at":"2017-11-02T11:15:57.000Z","dependencies_parsed_at":"2022-08-29T14:22:52.681Z","dependency_job_id":null,"html_url":"https://github.com/nguyenchr/strummer-prop-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenchr%2Fstrummer-prop-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenchr%2Fstrummer-prop-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenchr%2Fstrummer-prop-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenchr%2Fstrummer-prop-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nguyenchr","download_url":"https://codeload.github.com/nguyenchr/strummer-prop-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244794894,"owners_count":20511516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["proptypes","react","strummer","validation"],"created_at":"2024-11-27T17:38:35.707Z","updated_at":"2026-05-21T07:18:40.639Z","avatar_url":"https://github.com/nguyenchr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strummer Prop Types\n\n\u003e Use strummer schemas as react prop types\n\n[![NPM](http://img.shields.io/npm/v/strummer-prop-types.svg?style=flat-square)](https://npmjs.org/package/strummer-prop-types)\n[![License](http://img.shields.io/npm/l/strummer-prop-types.svg?style=flat-square)](https://github.com/nguyenchr/strummer-prop-types)\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg)\n[![Build Status](https://travis-ci.org/nguyenchr/strummer-prop-types.svg?branch=master)](https://travis-ci.org/nguyenchr/strummer-prop-types)\n\n[![Dependencies](http://img.shields.io/david/nguyenchr/strummer-prop-types.svg?style=flat-square)](https://david-dm.org/nguyenchr/strummer-prop-types)\n[![Dev dependencies](http://img.shields.io/david/dev/nguyenchr/strummer-prop-types.svg?style=flat-square)](https://david-dm.org/nguyenchr/strummer-prop-types)\n\n## Why\n\n* Can share custom validators between server and client\n* Can do more complex validation out of the box (e.g. min and max length of a string)\n\n## Usage\n\n\n```js\nimport { Component } from 'react'\nconst s = require('strummer')\nconst sPropTypes = require('strummer-prop-types')\n\nclass MyComponent extends Component {\n  render () {\n    return (\n      \u003cdiv\u003e{this.props.message}\u003c/div\u003e\n    )\n  }\n}\n\nMyComponent.propTypes = sPropTypes({\n  message: s.string()\n})\n\nexport default MyComponent\n```\n\nor with a HOC\n\n```js\nimport { Component } from 'react'\nconst s = require('strummer')\nconst { WithProps } = require('strummer-prop-types')\n\nclass MyComponent extends Component {\n  render () {\n    return (\n      \u003cdiv\u003e{this.props.message}\u003c/div\u003e\n    )\n  }\n}\n\nconst schema = {\n  message: s.string()\n}\n\nexport default WithProps(MyComponent, schema)\n```\n\n## TODO\n\nAdd some tests","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenchr%2Fstrummer-prop-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnguyenchr%2Fstrummer-prop-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenchr%2Fstrummer-prop-types/lists"}