Skip to content

Instantly share code, notes, and snippets.

View andreipfeiffer's full-sized avatar
🤔
thinking...

Andrei Pfeiffer andreipfeiffer

🤔
thinking...
View GitHub Profile
Vue.component('Counter', {
functional: true,
render(createElement, context) {
return createElement(/**/)
}
})
<template>
<div class="list-container">
<ul v-if="items.length">
<li v-for="item in items">
{{ item.name }}
</li>
</ul>
<p v-else>No items found.</p>
</div>
</template>
Vue.component('User', {
template: '<span>{{ fullName }}</span>',
props: ['firstName', 'lastName'],
computed: {
fullName() {
return this.firstName + ' ' + this.lastName;
}
}
import { Image, Dimensions } from 'react-native';
export default class RemoteImage extends Component {
constructor() {
super();
this.state = {
// this data could be static or provided by a server or api
url: 'https://...',
originalWidth: 1920,
expect.extend({
toContainObject(received, argument) {
const pass = this.equals(received,
expect.arrayContaining([
expect.objectContaining(argument)
])
)
if (pass) {