![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Karet is an experimental library that allows you to embed Kefir observables into React Virtual DOM.
To use Karet, you simply import it as React
:
import React from "karet"
and you can then write React components:
const oncePerSecond = Kefir.interval(1000).toProperty(() => {})
const Clock = () =>
<div>
The time is {oncePerSecond.map(() => new Date().toString())}.
</div>
with VDOM that can have embedded Kefir observables.
NOTE: The result, like the Clock
above, is just a React component. If
you export it, you can use it just like any other React component and even in
modules that do not import karet
.
karet-lift
attributeKaret only lifts built-in HTML elements implicitly. The karet-lift
attribute
on a non-primitive element instructs Karet to lift the element.
For example, you could write:
import * as RR from "react-router"
import React from "karet"
const Link1 = ({...props}) => <RR.Link karet-lift {...props}/>
to be able to use Link1
with
embedded Kefir observables:
<Link1 href="https://www.youtube.com/watch?v=Rbm6GXllBiw"
ref={elem => elem && elem.focus()}>
{Kefir.sequentially(1000, [3, 2, 1, "Boom!"])}
</Link1>
Note that the ref
attribute is only there as an example to contrast
with $$ref
.
fromKefir(observableVDOM)
fromKefir
allows one to convert a Kefir observable of React elements into a
React element. It is useful in case the top-most element of a component depends
on a Kefir observable.
For example:
import {fromKefir} from "karet"
import {ifte} from "karet.util"
const Chosen = ({choice}) =>
fromKefir(ifte(choice, <True/>, <False/>))
Here ifte
from karet-util
returns an observable that is <True/>
when
choice
is true and otherwise <False/>
.
Note that the point of using fromKefir
in the above example is that we don't
want to wrap the ifte(...)
inside an additional element like this:
const Chosen = ({choice}) =>
<div>
{ifte(choice, <True/>, <False/>)}
</div>
fromClass(Component)
fromClass
allows one the lift a React component.
For example:
import * as RR from "react-router"
import {fromClass} from "karet"
const Link2 = fromClass(RR.Link)
WARNING: A difficulty with lifting components is that you will then need to
use the $$ref
attribute, which is not necessary when
using karet-lift
to lift an element.
$$ref
attributeThe $$ref
attribute on an element whose component is lifted using fromClass
<Link2 href="https://www.youtube.com/watch?v=Rbm6GXllBiw"
$$ref={elem => elem && elem.focus()}>
{Kefir.sequentially(1000, [3, 2, 1, "Boom!"])}
</Link2>
does the same thing as the ordinary
JSX
ref
attribute:
JSX/React treats ref
as a special case and it is not passed to components, so
a special name had to be introduced for it.
FAQs
Karet is a library that allows you to embed Kefir properties into React VDOM
The npm package karet receives a total of 0 weekly downloads. As such, karet popularity was classified as not popular.
We found that karet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.