Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
This repository was archived by the owner on Jul 28, 2022. It is now read-only.

Stencil Redux not functioning anymore after upgrading to Stencil One #22

@kelvincy

Description

@kelvincy

Stencil version:

 @stencil/core@1.0.0-beta.2
 @stencil/redux@0.1.1

I'm submitting a:

[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:
Components using redux code do not function correctly anymore using @stencil/redux after upgrading to Stencil One. The store seems to be returning undefined.

Expected behavior:
The store should be defined when initiating with the predefined setStore(store) method.

Steps to reproduce:
Create a store with reducers and initiate the store in a root component.

Related code:
store/index.ts

import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import reducers from '../reducers/index';
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';

const configureStore = (preloadedState: any) =>
  createStore(
    reducers,
    preloadedState,
    composeWithDevTools(applyMiddleware(logger, thunk)),
  );

export { configureStore };

Component

import { Component, Prop } from "@stencil/core";
import { Store } from "@stencil/redux";
import { configureStore } from "../../redux/store/index";

@Component({
  tag: "my-test",
  shadow: true
})
export class MyTestComponent {
  @Prop({ context: "store" }) store: Store;

  componentWillLoad() {
    // Configure store once in this root component
    this.store.setStore(configureStore({}));
  }

  render() {
    return (
      <div></div>
    )
  }
}

Other information:
Screenshot 2019-05-22 at 16 48 27

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