# react-proptypes-url-validator

> custom url validator for React PropTypes

Latest version **0.0.1** (published 2015-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-proptypes-url-validator
pnpm add react-proptypes-url-validator
yarn add react-proptypes-url-validator
bun add react-proptypes-url-validator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-04-24 |
| First published | 2015-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Brendan Irvine-Broque |
| Maintainers | brendanib |
| Keywords | react, propTypes, url-regex, validator |

## Links

- npm: https://www.npmjs.com/package/react-proptypes-url-validator
- Repository: https://github.com/irvinebroque/react-proptypes-url-validator
- Issues: https://github.com/irvinebroque/react-proptypes-url-validator/issues
- npm.io page: https://npm.io/package/react-proptypes-url-validator

## Dependencies (1)

- [url-regex](https://npm.io/package/url-regex.md) ^2.1.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-04-24

## README

[![Circle CI](https://circleci.com/gh/irvinebroque/react-proptypes-url-validator/tree/master.svg?style=svg)](https://circleci.com/gh/irvinebroque/react-proptypes-url-validator/tree/master)

# react-proptypes-url-validator

Custom [PropType](https://facebook.github.io/react/docs/reusable-components.html#prop-validation) that validates URLs. Depends on [url-regex](https://www.npmjs.com/package/url-regex).

### Usage

```
npm install --save react-proptypes-url-validator

var validateURL = require('react-proptypes-url-validator');

var Component = React.createClass({
  propTypes: {
    url: validateURL
  },

  render: function() {
    return <div />;
  }
});

// If you pass an invalid URL as props...
React.render(<Component url="httpz://foo/bar.notaurl" />);

// You'll get a console warning...
'Warning: Failed propType: Invalid url supplied to Component.'
```

### Why?

To warn if invalid URLs are passed down as props to React components. Particularly useful if your app has lots of external links, or if you're using React in a context with mixed server-side and client-side routing/rendering.

### Requirements

Uses template literals, so you'll need an ES6 environment (aka you're running Babel or equivalent), but if you're using React, you should probably be doing this anyways.

### License

MIT

---
_Source: https://npm.io/package/react-proptypes-url-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
