@airtable/blocks/ui#TablePicker JavaScript Examples
The following examples show how to use
@airtable/blocks/ui#TablePicker.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TableToSaveApiData.js From airtable-api-connection with MIT No Attribution | 6 votes |
export default function TableToSaveApiData() {
const dispatch = useDispatch();
const apiConfig = useSelector((state) => {
return state.app.apiConfig
})
const tableId = apiConfig.tableToSaveApiData;
const table = base.getTableByIdIfExists(tableId);
console.log('table', table);
const handleTableChange = (tableId) => {
dispatch(setTableToSaveApiData(tableId))
}
return (
<div className="">
<Form>
<Form.Group controlId="apiForm.ControlInput1">
<Form.Label>Table to save data</Form.Label>
<div>
<TablePicker
className="table-picker"
onChange={newTable => handleTableChange(newTable.id)}
width="320px"
table={table}
/>
</div>
</Form.Group>
</Form>
</div>
)
}