Socket
Socket
Sign inDemoInstall

react-detect-offline

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-detect-offline - npm Package Compare versions

Comparing version 1.0.6 to 2.0.0

17

dist/index.js

@@ -24,3 +24,4 @@ "use strict";

var unsupportedUserAgentsPattern = /Windows.*Chrome/;
// these browsers don't fully support navigator.onLine, so we need to use a polling backup
var unsupportedUserAgentsPattern = /Windows.*Chrome|Windows.*Firefox/;

@@ -85,3 +86,4 @@ var config = {

var children = this.props.children;
var wrapperType = this.props.wrapperType;
var _props$wrapperType = this.props.wrapperType,
wrapperType = _props$wrapperType === undefined ? "span" : _props$wrapperType;

@@ -102,12 +104,3 @@ // usual case: one child that is a react Element

var firstChild = childrenArray[0];
// use wrapperType if specified
if (!wrapperType) {
if (typeof firstChild === "string" || firstChild.type === "span") {
// use span for string or span children
wrapperType = "span";
} else {
// fallback on div
wrapperType = "div";
}
}
return _react.createElement.apply(undefined, [wrapperType, {}].concat(_toConsumableArray(childrenArray)));

@@ -114,0 +107,0 @@ }

{
"name": "react-detect-offline",
"version": "1.0.6",
"version": "2.0.0",
"description": "Offline and Online components for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,3 +8,4 @@ import React, {

const unsupportedUserAgentsPattern = /Windows.*Chrome/;
// these browsers don't fully support navigator.onLine, so we need to use a polling backup
const unsupportedUserAgentsPattern = /Windows.*Chrome|Windows.*Firefox/;

@@ -53,5 +54,6 @@ const config = {

}
renderChildren() {
const { children } = this.props;
let { wrapperType } = this.props;
const { wrapperType = "span" } = this.props;

@@ -71,12 +73,3 @@ // usual case: one child that is a react Element

const firstChild = childrenArray[0];
// use wrapperType if specified
if (!wrapperType) {
if (typeof firstChild === "string" || firstChild.type === "span") {
// use span for string or span children
wrapperType = "span";
} else {
// fallback on div
wrapperType = "div";
}
}
return createElement(wrapperType, {}, ...childrenArray);

@@ -83,0 +76,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc