This is a React component equivalent of Polymer platinum-https-redirect
The element redirects the current page to HTTPS, unless the page is loaded from a web server running on localhost.
You can read more information here.
Using npm:
npm install --save react-https-redirect
Supposing a CommonJS environment, you can simply use the component in this way:
import HttpsRedirect from 'react-https-redirect';
class App extends React.Component {
render() {
return (
<Providers>
<HttpsRedirect>
<Children />
</HttpsRedirect>
<Providers />
);
}
}
Matteo Basso
Copyright (c) 2016, Matteo Basso.
React-https-redirect source code is licensed under the MIT License.