The app that displayed user name through swapi API.
Demo:
Code example:
import * as React from 'react';
import { Page, Frame, StyleSheet, Text, useFetch } from 'react-figma';
export const App = () => {
const { isLoading, data } = useFetch(`https://swapi.co/api/people/1`);
return (
<Frame>
<Text>{`isLoading: ${(isLoading && 'true') || 'false'}`}</Text>
<Text>{`Name: ${data && data.name}`}</Text>
</Frame>
);
};