kiliman / remix-typedjson

This package is a replacement for superjson to use in your Remix app. It handles a subset of types that `superjson` supports, but is faster and smaller.
MIT License
435 stars 19 forks source link

Update README: `DataFunctionArgs` is being deprecated #38

Closed fernandocanizo closed 8 months ago

fernandocanizo commented 8 months ago

Hi, according to this PR from Remix, DataFunctionArgs is being deprecated, so where the README says: "Make sure your loader and action use the new declaration format:", the example should look like:

// Old ways
export const loader: LoaderFunction = async ({request}) => {}
export const action: ActionFunction = async ({request}) => {}
export const loader = async ({request}: DataFunctionArgs) => {}
export const action = async ({request}: DataFunctionArgs) => {}

// New way
export const loader = async ({request}: LoaderFunctionArgs) => {}
export const action = async ({request}: ActionFunctionArgs) => {}

Although I don't know if there's also code to be touched before editing the documentation.

kiliman commented 8 months ago

Thanks for the heads up!