![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@laboratoria/react
Advanced tools
Este repo contiene componentes, hooks y otras cositas que queremos reusar entre varias interfaces de Laboratoria. Este módulo depende de [`@laboratoria/sdk-js`](https://www.npmjs.com/package/@laboratoria/sdk-js) y contiene un _hook_ (`useApp`) que nos da
Este repo contiene componentes, hooks y otras cositas que queremos reusar entre
varias interfaces de Laboratoria. Este módulo depende de
@laboratoria/sdk-js
y
contiene un hook (useApp
) que nos da acceso al objeto app
del SDK. Con lo
cual, si estás usando este módulo desde una app en React, no necesitas instalar
directamente @laboratoria/sdk-js
.
Se asume que las interfaces en cuestión todas usan React, React router DOM y MUI.
{
"peerDependencies": {
"@mui/material": "^5.5.3",
"@mui/styles": "^5.5.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^6.3.0"
}
}
El hook useApp
nos da una referencia al objeto app
de
@laboratoria/sdk-js
, el cual se puede configurar con las siguientes variables de entorno:
REACT_APP_FIREBASE_API_KEY
REACT_APP_FIREBASE_PROJECT
REACT_APP_LABORATORIA_CORE_API_URL
REACT_APP_LABORATORIA_JOBS_API_URL
import React from 'react';
import ReactDOM from 'react-dom';
import {
createTheme,
ThemeProvider,
StyledEngineProvider,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
// Importamos `AppProvider` y `themeConfig`
import { AppProvider, themeConfig } from '@laboratoria/react';
// Importamos el CSS base...
import '@laboratoria/react/src/theme/index.css';
import App from './components/App';
ReactDOM.render(
<React.StrictMode>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={createTheme(themeConfig)}>
<AppProvider>
<CssBaseline />
<App />
</AppProvider>
</ThemeProvider>
</StyledEngineProvider>
</React.StrictMode>,
document.getElementById('root')
);
Para usar este repo linkeado localmente en otros repos que lo usen como
dependencia (laboratoria.la
, admin
, etc):
# en @laboratoria/react
rm -rf node_modules
npm i --omit peer
npm run link-sdk
npm run watch
# en repo que usa @laboratoria/react
npm run link-react
rm -rf node_modules/.cache
FAQs
Este repo contiene componentes, hooks y otras cositas que queremos reusar entre varias interfaces de Laboratoria. Este módulo depende de [`@laboratoria/sdk-js`](https://www.npmjs.com/package/@laboratoria/sdk-js) y contiene un _hook_ (`useApp`) que nos da
The npm package @laboratoria/react receives a total of 0 weekly downloads. As such, @laboratoria/react popularity was classified as not popular.
We found that @laboratoria/react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.