
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@laerdal/life-react-components
Advanced tools
cd /path/to/your-app
yarn add @laerdal/life-react-components
or npm add @laerdal/life-react-components
There are several providers required for Life React JS components to work as expected. You need to wrap your APP with all of them:
ThemeProvider This is default ThemeProvider from styled-components package. It should define the theme. 'Theme' object should be provided, even it if is just blank object. Theme object can contain name of the theme. Acceptable values: dark, light, rqi_dark, rqi_light. Also ThemeProvider can be used to override colors of the theme.
ToastProvider Provider with Toast related context. Wrap your whole app with this if you want to have ability to show/hide Toasts using Life React JS
NavigationProvider NavigationProvider - provides library components with navigation, routing and active-route functionality. It has 3 functions:
navigate?: (path: string, isExternal: boolean) => void;
Navigate to a different path. If navigation is happening to the external source, please set 'isExternal' to true.
currentPath?: string | undefined;
Current path in the navigation context.
isActiveRoute?: (url: string, exact: boolean) => boolean;
Check if a route is active, if 'exact' flag is set then we should check for exact match, and not just part of the route
If you are still using React Router and don't want to remove it from list of your dependencies, you can find implementation of CustomNavigationProvider at https://github.com/Laerdal-Medical/dcs-life-react-js/blob/dev/libraries/react-components/.storybook/custom-navigation-provider.tsx <- this implementation is used at Storybook.
LifeGlobalStyles React component that should be placed in the App.tsx of your project. This component will include coloring for chosen theme and add global styles like fonts and others.
After adding all providers defined about you can include components or icons and use them.
import { TextButton } from '@laerdal/life-react-components'
import { ChevronLeft, ChevronRight } from '@laerdal/life-react-components'
cd /path/to/your-app
yarn add @laerdal/life-react-components
or npm add @laerdal/life-react-components
cd /path/to/react-components
yarn link
cd /path/to/your-app
yarn link “@laerdal/life-react-components”
yarn
When you start your application, you might get an “Invalid Hook Call Warning”. This is because both component-library and your-app loads their own version of react and react dom. Make sure component-library uses the same version of react and react-dom as your-app uses:
npm add npm-link-shared -g
cd /path/to/your-app
sudo npm-link-shared /path/to/react-components/node_modules . react react-dom
Storybook is added to the component library package to demo and document the components. Clone the repository, run yarn
, then cd apps/storybook
and run yarn storybook
to start it locally.
FAQs
Laerdal LIFE component library for React.
The npm package @laerdal/life-react-components receives a total of 472 weekly downloads. As such, @laerdal/life-react-components popularity was classified as not popular.
We found that @laerdal/life-react-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.