A group of components used to display the licenses your expo app is using
Install using npm or yarn:
npm i expo-license-list
yarn add expo-license-list
Generate the license JSON data using the following script (you need npm-license-crawler
):
npm-license-crawler -onlyDirectDependencies -json ./assets/licenses.json
Then use like this:
import * as React from 'react';
import {
LicenseList,
getLicensesFromJSON,
LicenseListItem,
} from 'expo-license-list';
import { openBrowserAsync } from "expo-web-browser";
import licenses from './assets/licenses.json';
export default function App() {
return (
<LicenseList
data={getLicensesFromJSON(licenses)}
renderItem={({ item }) => (
<LicenseListItem onPress={(url) => openBrowserAsync(url)} {...item} />
)}
/>
);
}
See the documentation for more technical info.
- Add tests.