Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@convex-dev/react
Advanced tools
Readme
React hooks for updating components based on changed in the Convex Cloud. This package is a layer on top of @convex-dev/browser which allows binding to React components. For convenience, it re-exports all of @convex-dev/browser's exports too.
Convex is a platform for building dynamic applications without the complexity of managing a backend or interacting with a database. Data access functions run on the Convex Cloud platform and use the @convex-dev/server libraries to read and manipulate data. This package is used in frontend code to interact with these server-side functions.
See the Convex documentation to get started!
This library is typically used alongside a more precisely typed client describing the particular Convex functions available to an application, generated by the Convex command line tool. Use alongside a generated client is the preferred way to use this library, but it can also be used directly, which is required for projects which that do not use TypeScript.
To generate a client, run npx convex codegen
in any Convex project. A
TypeScript module at convex/_generated.ts
providing typed versions of three
React hooks for communicating with a Convex backend instance will be created or
updated.
useQuery
takes an initial argument specifying the Convex function to call and
passes additional arguments to that Convex function. As a React hook with
internal state, every update to the queried value will cause the component where
the hook is used to rerender.
This function can be manually created by [makeUserQuery
] with a type argument
describing an API extending GenericAPI
.
useMutation
takes a single argument specifying a Convex mutation and returns a
Mutation
. Mutation objects can be called
like functions to request execution of the corresponding Convex function, or
further configured with optimistic updates. The
value returned by this hook is stable across renders, so it can be used by React
dependency arrays and memoization logic relying on object identity without
causes rerenders.
This function can be manually created by [makeUseMutation
] with a type
argument describing an API extending
GenericAPI
.
Returns the ConvexReactClient provided by an ancestor ConvexProvider React component.
This function can be manually created by [makeUseConvex
] with a type argument
describing an API extending GenericAPI
.
When using this library,
useQueryGeneric
,
useMutationGeneric
, and
useConvexGeneric
provide untyped
versions React hooks above.
FAQs
Unknown package
We found that @convex-dev/react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).