Skip to content

Commit

Permalink
fix: Type issue with RN (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Oct 9, 2023
1 parent 41ac06b commit 9ac7090
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -34,3 +34,18 @@ jobs:
- run: yarn compile
- run: yarn lint
- run: yarn prettier:check

type-check:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 16
- run: |
yarn
cd examples/example-expo
yarn global add yalc
yarn
yarn tsc
2 changes: 2 additions & 0 deletions posthog-core/src/index.ts
Expand Up @@ -36,6 +36,8 @@ class PostHogFetchNetworkError extends Error {
name = 'PostHogFetchNetworkError'

constructor(public error: unknown) {
// TRICKY: "cause" is a newer property but is just ignored otherwise. Cast to any to ignore the type issue.
// @ts-ignore
super('Network error while fetching PostHog', error instanceof Error ? { cause: error } : {})
}
}
Expand Down
4 changes: 4 additions & 0 deletions posthog-react-native/CHANGELOG.md
@@ -1,3 +1,7 @@
# 2.8.1 - 2023-10-09

1. Fixes a type generation issue

# 2.8.0 - 2023-10-06

1. Added new `const [flag, payload] = useFeatureFlagWithPayload('my-flag-name')` hook that returns the flag result and it's payload if it has one.
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/package.json
@@ -1,6 +1,6 @@
{
"name": "posthog-react-native",
"version": "2.8.0",
"version": "2.8.1",
"main": "lib/posthog-react-native/index.js",
"files": [
"lib/"
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/src/posthog-rn.ts
Expand Up @@ -6,7 +6,7 @@ import {
PostHogFetchOptions,
PostHogFetchResponse,
PostHogPersistedProperty,
} from '../../posthog-core'
} from '../../posthog-core/src'
import { PostHogMemoryStorage } from '../../posthog-core/src/storage-memory'
import { getLegacyValues } from './legacy'
import { SemiAsyncStorage } from './storage'
Expand Down

0 comments on commit 9ac7090

Please sign in to comment.