Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.