Skip to content

Universal gl-react module that implements BlurHash in OpenGL

License

Notifications You must be signed in to change notification settings

schiller-manuel/gl-react-blurhash

Repository files navigation

gl-react-blurhash runs with expo

Universal gl-react module that implements BlurHash in OpenGL.

Installation

Expo

Add the following dependencies:

expo add gl-react gl-react-expo expo-gl buffer gl-react-blurhash

React Native

First setup react-native-unimodules, then add the following dependencies:

yarn add gl-react gl-react-native buffer gl-react-blurhash

Usage

import React from 'react';
import { Surface } from 'gl-react-expo'; // 'gl-react-native' for React Native
import { Blurhash } from 'gl-react-blurhash';

export default function App {
    return (
        <Surface style={{ width: 300, height: 200 }}>
            <Blurhash hash="LPKA$w{H_c05b{Nqwbx^grotMnNf" />
        </Surface>
    );
}

Example

See example subfolder for a full example. This example is also available on snack.expo.io.