Skip to content

Instantly share code, notes, and snippets.

@JonnyBurger
JonnyBurger / UPGRADING.md
Last active February 20, 2019 04:08
Tips for upgrading React Native (especially >0.45)

Here are a few tips if you have trouble upgrading versions of React Native.

Upgrading dependencies for React 16 ([email protected] and above)

[email protected] uses React 16, while previous versions use React 15. Be aware that React 16 is still in Alpha, so unless you need features in React Native 0.45 or above, consider sticking to v0.44 for now.

If you upgrade, several dependencies need to be updated manually:

  • react should be on 16.0.0-alpha.12

Graphical User Interfaces

Last time I wrote a little bit about my current GUI research progress. There are some things that were misunderstood so I want to clarify some fundamental design decisions and finally write up some current problems and their solutions.

First up I want to clarify a component is not another term for what is usually refered to as widget. Instead wigets in this implementation are made out of n >= 1 components. Components themself are just rectangles with attributes left, right, top, bottom, center_x, center_y, width and height some behavior flags and an optional surface to draw into. For example a scroll regions is made up out of at least three

@xhjkl
xhjkl / log.h
Created April 7, 2017 20:23
Logical logging for C11
//
// Logging facility
//
// Expecting to be included:
// <stdio.h>
// <inttypes.h>
#define _overload7(one, two, three, four, five, six, seven, x, ...) x
@eiriklv
eiriklv / avoiding-exceptions.js
Last active February 2, 2019 12:13
Exception free JavaScript?
/**
* WHY? - BECAUSE EXCEPTIONS/TRY/CATCH IS A GLOBAL HORRIBLE MESS :-(
* Check out error handling in golang: https://blog.golang.org/error-handling-and-go
*/
/**
* Wrap an "unsafe" promise
*/
function safePromise(promise) {
return promise
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
TouchableHighlight,
ScrollView,
StatusBar,
Dimensions,
Animated
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
ScrollView
} from 'react-native'
import Redirect from 'react-router/Redirect'
import Match from 'react-router/Match'
@andrey-skl
andrey-skl / AppDelegate.m
Created November 16, 2016 14:36
How to enable logging in production build of React Native app
...
#import "RCTLog.h"
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTSetLogThreshold(RCTLogLevelInfo);
...
@alexesDev
alexesDev / main.cpp
Last active December 13, 2022 09:00
Redux c++ implementation
#include <mapbox/variant.hpp>
#include <redux.hpp>
struct Increment
{
};
struct Decrement
{
};
@liamzebedee
liamzebedee / BackgroundTask.h
Last active February 18, 2024 09:27
Attempts at implementing background tasks in React Native iOS
//
// BackgroundTask.h
// tomtrack
//
// Created by Liam Edwards-Playne on 13/02/2016.
//
#import "RCTBridgeModule.h"
@interface BackgroundTask : NSObject <RCTBridgeModule>