cloudflare / cloudflare/templates

cf properties are undefined in react-router example

Open
#601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.1k
Forks
1k
Avg merge
17h 44m
Merged PRs (30d)
10

Description

I used the [same example](https://github.com/cloudflare/templates/blob/main/react-router-starter-template/workers/app.ts) and deployed on a worker

```

export default {
fetch(request, env, ctx) {
return requestHandler(request, {
cloudflare: { env, ctx },
});
},
} satisfies ExportedHandler;
```

The cf properties are undefined.

```
export const loader = async ({
context,
request,
}: Route.LoaderArgs): Promise => {
const { env, ctx } = context.cloudflare;
const ip_address = request.headers.get("CF-Connecting-IP");

console.log("CF Props", request.cf);
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.