react-tabs#resetIdCounter JavaScript Examples
The following examples show how to use
react-tabs#resetIdCounter.
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: _document.js From plataforma-sabia with MIT License | 6 votes |
static async getInitialProps(ctx) {
resetIdCounter();
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
});
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
};
} finally {
sheet.seal();
}
}
Example #2
Source File: curate-technologies.js From plataforma-sabia with MIT License | 6 votes |
CurateTechnologies.getInitialProps = async (ctx) => {
resetIdCounter();
const { query } = ctx;
const page = Number(query.page) || 1;
const itemsPerPage = 5;
const sortOptions = [
{ value: 'title', label: 'Título' },
{ value: 'status', label: 'Status' },
{ value: 'updated_at', label: 'Última atualização' },
];
const { technologies = [], totalPages = 1, totalItems = 1 } =
(await getTechnologiesToCurate({
...query,
perPage: itemsPerPage,
page,
status: statusReadyToCurate.map((item) => item).join(),
})) || {};
return {
technologies,
currentPage: page,
totalPages,
totalItems,
itemsPerPage,
currentSort: { by: query.orderBy, order: query.order },
sortOptions,
};
};