Skip to content

LocationProvider isn't used in all examples, making it unclear that it's required #23

@donkeyDau

Description

@donkeyDau

I try to switch from preact-router to preact-iso but I'm already failing at the simplest implementation.

I have a minimal working example:

import { h, render } from 'preact';
import { lazy, Router } from 'preact-iso';

const HelloWorld = lazy(() => import('./HelloWorld.js'));

const AppWrapper = () => {
  return (
    <Router>
      <HelloWorld path="/" />
    </Router>
  );
};

render(<AppWrapper />, document.body);

Crashes with:

Uncaught TypeError: A is undefined
Preact 38
index.js:63
router.js:42:1
Preact 2
some self-hosted:137
Preact 36
index.js:63

Looking at the exec function I assume that the passed url is undefined as the RouteContext is just an empty object. Maybe I'm missing something fundamental here ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions