react-social-kr
Advanced tools
@@ -24,2 +24,5 @@ 'use strict'; | ||
}; | ||
var isMobile = function isMobile() { | ||
return navigator.userAgent.match('CriOS') || navigator.userAgent.match(/mobile/i); | ||
}; | ||
@@ -211,2 +214,7 @@ var getLocation = function getLocation(pathname) { | ||
}, | ||
getInitialState: function getInitialState() { | ||
return { | ||
isNotRender: false | ||
}; | ||
}, | ||
click: function click(evt) { | ||
@@ -222,2 +230,4 @@ var url = this.constructUrl(); | ||
render: function render() { | ||
if (this.state.isNotRender) return null; | ||
var other = spread(this.props, ['onClick', 'element', 'pathname', 'getLocation', '_open', 'message', 'appId', 'sharer', 'media', 'windowOptions', 'jsKey']); | ||
@@ -571,6 +581,7 @@ | ||
}, | ||
componentWillMount: function componentWillMount() { | ||
if (!isMobile()) this.setState({ isNotRender: true }); | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
if (!isBrowser()) { | ||
return true; | ||
} | ||
if (!isBrowser() || !isMobile()) return true; | ||
@@ -577,0 +588,0 @@ if (!document.getElementById('KakaoJSSDK')) { |
{ | ||
"name": "react-social-kr", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "React social buttons and counts for Facebook, Pinterest, Google, Naver, KaKao etc ...", | ||
@@ -5,0 +5,0 @@ "main": "lib/react-social.js", |
@@ -98,3 +98,3 @@ # react-social-kr | ||
- KaKaoStoryButton | ||
- KaKaoTalkButton | ||
- KaKaoTalkButton (only visible on iOS/Android browsers.) | ||
@@ -101,0 +101,0 @@ ### Props |
36508
1.24%700
1.45%