Skip to content

Commit

Permalink
fix(odd-preact): remove jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed May 16, 2023
1 parent 031a679 commit 388bee2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/odd-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./src/index.jsx"
"import": "./src/index.js"
},
"./router": {
"types": "./dist/src/router.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable unicorn/no-null */
/* eslint-disable unicorn/no-useless-undefined */
import { createContext } from 'preact'
import { createContext, createElement } from 'preact'
import {
useCallback,
useContext,
Expand Down Expand Up @@ -156,7 +156,7 @@ export function OddContextProvider({
}
}, [program, error, session, isUsernameAvailable, login])

return <OddContext.Provider value={value}>{children}</OddContext.Provider>
return createElement(OddContext.Provider, { value, children })
}

export function useOddContext() {
Expand Down
2 changes: 1 addition & 1 deletion packages/odd-preact/src/router.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'preact/hooks'
import { route } from 'preact-router'
import { useOddContext } from './index.jsx'
import { useOddContext } from './index.js'

export function useOdd({ redirectTo = '', redirectIfFound = false } = {}) {
const context = useOddContext()
Expand Down
28 changes: 3 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 388bee2

Please sign in to comment.