Skip to content

Instantly share code, notes, and snippets.

@dayaki
Last active June 29, 2022 07:17
Show Gist options
  • Save dayaki/c3c5baf676cecae7e968d65383dee7a1 to your computer and use it in GitHub Desktop.
Save dayaki/c3c5baf676cecae7e968d65383dee7a1 to your computer and use it in GitHub Desktop.
Blockli template file
import React from "react";
import { NativeModules } from "react-native";
const { RNCustomCode } = NativeModules;
// Import needed Blockli Blocks here
import {
initialize,
BlockliVideo,
} from "@blocklienterprise/blockli";
import config from "@src/build_config.json";
export const applyCustomCode = async (externalCodeSetup) => {
const { blocksApi } = externalCodeSetup;
// You MUST all this function with your License code to be able to use Blockli Blocks
await initialize("LICENSE-CODE-HERE", config.app_id);
// Here is a sample call to use Blockli Blog Block.
// Watch our "how-to" to learn how to add other Blockli Blocks.
blocksApi.addCustomBlockRender("blockli/blog-cards", (props) => (
<BlockliBlog {...props} />
));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment