Package Exports
- use-value-enhancer
- use-value-enhancer/dist/use-value-enhancer.js
- use-value-enhancer/dist/use-value-enhancer.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-value-enhancer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
use-value-enhancer
React hooks for value-enhancer.
Install
npm add use-value-enhancer value-enhancer react
Usage
import { useVal } from "use-value-enhancer";
const value = useVal(val$);
Example
import React from "react";
import ReactDOM from "react-dom/client";
import { val } from "value-enhancer";
import { useVal } from "use-value-enhancer";
export const App = ({ prefix$ }) => {
const prefix = useVal(prefix$);
return <div>{prefix} World!</div>;
};
const prefix$ = val("Hello");
ReactDOM.createRoot(document.getElementById("root"))
.render(<App prefix$={prefix$} />);