D0Z
D0Z
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
mmhm why not, I got a shitty mic since I'm not at home but we could try
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
I can make one
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
Heèy I tried setting up the editor but dunno why I can't manage to make packages works
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
tried with config based routing with no luck either and suspense isn't showing "loading" on resource fetch...
import { ErrorBoundary, lazy, Suspense } from 'solid-js'

import { RouteDefinition } from '@solidjs/router'

import useFindAllProject from './hooks/project/useFindAllProject'
import E404 from './screens/E404'
import Home from './screens/Home'
import MainLayout from './screens/MainLayout'

const ProjectsLayout = lazy(() => import('./screens/projects/ProjectsLayout'))
const Projects = lazy(() => import('./screens/projects'))
const Project = lazy(() => import('./screens/projects/project'))

const routes: RouteDefinition[] = [
{
path: '/',
component: MainLayout,
children: [
{
path: '/',
component: Home
},
{
path: '/projects',
data: useFindAllProject,
component: () => (
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Suspense fallback={<>LOADING</>}>
<ProjectsLayout />
</Suspense>
</ErrorBoundary>
),
children: [
{
path: '/',
component: () => (
<Suspense fallback={<>LOADING</>}>
<Projects />
</Suspense>
)
},
{
path: '/:projectId',
component: () => (
<Suspense fallback={<>LOADING</>}>
<Project />
</Suspense>
)
}
]
},
{
path: '/*',
component: E404
}
]
}
]

export default routes
import { ErrorBoundary, lazy, Suspense } from 'solid-js'

import { RouteDefinition } from '@solidjs/router'

import useFindAllProject from './hooks/project/useFindAllProject'
import E404 from './screens/E404'
import Home from './screens/Home'
import MainLayout from './screens/MainLayout'

const ProjectsLayout = lazy(() => import('./screens/projects/ProjectsLayout'))
const Projects = lazy(() => import('./screens/projects'))
const Project = lazy(() => import('./screens/projects/project'))

const routes: RouteDefinition[] = [
{
path: '/',
component: MainLayout,
children: [
{
path: '/',
component: Home
},
{
path: '/projects',
data: useFindAllProject,
component: () => (
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Suspense fallback={<>LOADING</>}>
<ProjectsLayout />
</Suspense>
</ErrorBoundary>
),
children: [
{
path: '/',
component: () => (
<Suspense fallback={<>LOADING</>}>
<Projects />
</Suspense>
)
},
{
path: '/:projectId',
component: () => (
<Suspense fallback={<>LOADING</>}>
<Project />
</Suspense>
)
}
]
},
{
path: '/*',
component: E404
}
]
}
]

export default routes
12 replies
SSolidJS
Created by D0Z on 7/16/2023 in #support
Nested ErrorBoundary not used
I also tried to move the nested ErrorBoundary in the return of App but it didn't change anything:
const App = (): JSX.Element => {
return (
<Suspense>
<I18nProvider>
<ProjectProvider>
<Router>
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Routes>
<Route path="/" component={MainLayout}>
<Route path="/" component={Home} />

<Route
path="/projects"
data={useFindAllProject}
component={() => (
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<ProjectsLayout />
</ErrorBoundary>
)}
>
<Route path="/" component={Projects} />
<Route path="/:projectId" component={Project} />
</Route>
<Route path="/*" component={E404} />
</Route>
</Routes>
</ErrorBoundary>
</Router>
</ProjectProvider>
</I18nProvider>
</Suspense>
)
}
const App = (): JSX.Element => {
return (
<Suspense>
<I18nProvider>
<ProjectProvider>
<Router>
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Routes>
<Route path="/" component={MainLayout}>
<Route path="/" component={Home} />

<Route
path="/projects"
data={useFindAllProject}
component={() => (
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<ProjectsLayout />
</ErrorBoundary>
)}
>
<Route path="/" component={Projects} />
<Route path="/:projectId" component={Project} />
</Route>
<Route path="/*" component={E404} />
</Route>
</Routes>
</ErrorBoundary>
</Router>
</ProjectProvider>
</I18nProvider>
</Suspense>
)
}
OR
const App = (): JSX.Element => {
return (
<Suspense>
<I18nProvider>
<ProjectProvider>
<Router>
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Routes>
<Route path="/" component={MainLayout}>
<Route path="/" component={Home} />
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Route
path="/projects"
data={useFindAllProject}
component={ProjectsLayout}
>
<Route path="/" component={Projects} />
<Route path="/:projectId" component={Project} />
</Route>
</ErrorBoundary>
<Route path="/*" component={E404} />
</Route>
</Routes>
</ErrorBoundary>
</Router>
</ProjectProvider>
</I18nProvider>
</Suspense>
)
}
const App = (): JSX.Element => {
return (
<Suspense>
<I18nProvider>
<ProjectProvider>
<Router>
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Routes>
<Route path="/" component={MainLayout}>
<Route path="/" component={Home} />
<ErrorBoundary fallback={(e) => <>{e.message}</>}>
<Route
path="/projects"
data={useFindAllProject}
component={ProjectsLayout}
>
<Route path="/" component={Projects} />
<Route path="/:projectId" component={Project} />
</Route>
</ErrorBoundary>
<Route path="/*" component={E404} />
</Route>
</Routes>
</ErrorBoundary>
</Router>
</ProjectProvider>
</I18nProvider>
</Suspense>
)
}
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
oh alright removing readonly worked, thanku 😄
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
here is the declaration of setState for version 1.6.9
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
what version of solid is the playground in ?
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
so it might come from my ts config ?
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
huh
12 replies
SSolidJS
Created by D0Z on 1/24/2023 in #support
Argument of type 'string' is not assignable to parameter of type 'never'.
/**
* Store type
*/
type StoreState = {
readonly toolMode: ToolMode
readonly cursor: string
readonly drawColor: string
readonly drawWidth: number
}

/**
* Context type
*/
type ContextState = [
state: StoreState,
actions: {
/**
* Set Tool Mode
* @param toolMode
*/
setToolMode: (toolMode: ToolMode) => void
/**
* Set cursor
* @param cursor
*/
setCursor: (cursor: string) => void
/**
* Set Draw Color
* @param drawColor
*/
setDrawColor: (drawColor: string) => void
/**
* Set Draw Width
* @param drawWidth
*/
setDrawWidth: (drawWidth: number) => void
}
]

/**
* Initial state of the store
*/
const initialState: StoreState = {
toolMode: ToolMode.CURSOR,
cursor: 'inherit',
drawColor: '#000000',
drawWidth: 3
}

/**
* Context
*/
const UxContext = createContext<ContextState>()
/**
* Store type
*/
type StoreState = {
readonly toolMode: ToolMode
readonly cursor: string
readonly drawColor: string
readonly drawWidth: number
}

/**
* Context type
*/
type ContextState = [
state: StoreState,
actions: {
/**
* Set Tool Mode
* @param toolMode
*/
setToolMode: (toolMode: ToolMode) => void
/**
* Set cursor
* @param cursor
*/
setCursor: (cursor: string) => void
/**
* Set Draw Color
* @param drawColor
*/
setDrawColor: (drawColor: string) => void
/**
* Set Draw Width
* @param drawWidth
*/
setDrawWidth: (drawWidth: number) => void
}
]

/**
* Initial state of the store
*/
const initialState: StoreState = {
toolMode: ToolMode.CURSOR,
cursor: 'inherit',
drawColor: '#000000',
drawWidth: 3
}

/**
* Context
*/
const UxContext = createContext<ContextState>()
12 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
Alright then you have my most sincere thanks for your time 😄 and I might come here again soon x)
19 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
Is there any way I can thank you like buy you a coffee or something ? you've helped me quite a few times already
19 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
alright
19 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
can I continue to chain up argument after a produce, for example
setState(
'layers',
layerIndex,
produce(layer => {
if (!layer.features) layer.features = []
},
'features',
produce(...)
)
setState(
'layers',
layerIndex,
produce(layer => {
if (!layer.features) layer.features = []
},
'features',
produce(...)
)
19 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
oh nice thanks for the tip
19 replies
SSolidJS
Created by D0Z on 1/17/2023 in #support
updating nested object not triggering update
alright it seems to work now I need to find why the component won't update ^^' I'm using a fairly complicated setud with solid-map-gl and trying to update a geojson layer
19 replies