import React from 'react'
import {View, Text, StyleSheet} from 'react-native'
import {WebView} from 'react-native-webview'
export const Browser = props => {
return (
<View style={{flex:1, width:"100%",height:"100%"}}>
<WebView source={{uri: 'http://facebook.com/'}} style={{flex:1}} javaScriptEnabled={true} />
</View>
)
}
const singers = [
{ name: 'Steven Tyler', band: 'Aerosmith', born: 1948 },
{ name: 'Karen Carpenter', band: 'The Carpenters', born: 1950 },
{ name: 'Kurt Cobain', band: 'Nirvana', born: 1967 },
{ name: 'Stevie Nicks', band: 'Fleetwood Mac', born: 1948 },
];
function compareValues(key, order = 'asc') {
return function innerSort(a, b) {
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
// property doesn't exist on either object
return 0;
}
const varA = (typeof a[key] === 'string')
? a[key].toUpperCase() : a[key];
const varB = (typeof b[key] === 'string')
? b[key].toUpperCase() : b[key];
let comparison = 0;
if (varA > varB) {
comparison = 1;
} else if (varA < varB) {
comparison = -1;
}
return (
(order === 'desc') ? (comparison * -1) : comparison
);
};
}
// array is sorted by band, in ascending order by default
singers.sort(compareValues('band'));
// array is sorted by band in descending order
singers.sort(compareValues('band', 'desc'));
let [slidesCount, setSlidesCount] = useState(0);
useEffect(() => {
setSlidesCount(document.querySelectorAll('.slick-list .slick-slide:not(.slick-cloned)').length)
console.log(slidesCount) //Сначала выводит 0, потом 4
}, [slidesCount]);
componentDidMount() {
window.addEventListener('mousemove', () => {})
}
componentWillUnmount() {
window.removeEventListener('mousemove', () => {})
}
useEffect(() => {
window.addEventListener('mousemove', () => {});
// returned function will be called on component unmount
return () => {
window.removeEventListener('mousemove', () => {})
}
}, [])
const current ={lat: "59.95", lng: "30.33"}
const newObj={lat:parseFloat(current.lat),lng:parseFloat(current.lng)}
Our custom Firebase token will expire in 3600 seconds (1 hour). This is only half as long as our default Auth0 access token lifetime (which is 7200 seconds, or 2 hours).
var user = firebase.auth().currentUser;
var name, email, photoUrl, uid, emailVerified;
if (user != null) {
name = user.displayName;
email = user.email;
photoUrl = user.photoURL;
emailVerified = user.emailVerified;
uid = user.uid; // The user's ID, unique to the Firebase project. Do NOT use
// this value to authenticate with your backend server, if
// you have one. Use User.getToken() instead.
}
handleClick = function() {
this.setState(function (state) {
return {
isActive: !state.isActive
};
});
};
this.handleClick=this.handleClick.bind()