react-hybrid icon indicating copy to clipboard operation
react-hybrid copied to clipboard

Redux support?

Open GuyPie opened this issue 7 years ago • 8 comments

When using this library with Redux I'm getting the error 'Error: Could not find "store" in either the context or props'. Is it possible to send the redux store to the router in some way?

GuyPie avatar Sep 20 '17 09:09 GuyPie

Hi,

I am wondering the same thing too. Much appreciated if any help can be provided on this topic. Thanks!

vladsoroceanu avatar Jun 11 '18 08:06 vladsoroceanu

any plan to add redux support?

PM00095 avatar Oct 19 '18 17:10 PM00095

I hope It has been fixed in 0.3.6. @vladsoroceanu @PM00095 could you check it, please?

Anber avatar Nov 09 '18 10:11 Anber

#138

christopherthielen avatar Nov 09 '18 19:11 christopherthielen

Let me check that and let me know if found some issues.

PM00095 avatar Nov 09 '18 20:11 PM00095

did any of you get redux working with this? I get the following problems when I connect state to props:

Unknown provider: [object Object]DirectiveProvider <- [object Object]Directive]

Is there anyway of doing in this in javascript? <Provider store={store}> <App /> </Provider>

philmday avatar Oct 05 '19 15:10 philmday

@philmday, looks like hybrid can’t recognize the type of your view. You can specify it explicitly by adding $type: "react" to your view definition.

Anber avatar Oct 05 '19 16:10 Anber

@Anber @philmday
I too have the same issue: I define the states in angularjs code, added $type, still does not see the store getting:

		$stateProvider
			.state('index', {
			url: _embeddedContextRoot,
			abstract: true,
			component: ReactHome,
			$type: "react"
		})
       .state('main', {
				parent: 'index',
				url: '/main',
				$type: "react",
				views: {
					mainContent: {
						component: Overview
					}
				}
			})

Result:

angular.js:15567 Error: [$injector:unpr] Unknown provider: [object Object]DirectiveProvider <- [object Object]Directive
https://errors.angularjs.org/1.7.8/$injector/unpr?p0=%5Bobject%20Object%5DDirectiveProvider%20%3C-%20%5Bobject%20Object%5DDirective
    at angular.js:138
    at angular.js:4924
    at Object.getService [as get] (angular.js:5084)
    at angular.js:4929
    at Object.getService [as get] (angular.js:5084)
    at getComponentBindings (templateFactory.js:179)
    at TemplateFactory.push../node_modules/@uirouter/angularjs/lib-esm/templateFactory.js.TemplateFactory.makeComponentTemplate (templateFactory.js:168)
    at Ng1ViewConfig.getTemplate (views.js:74)
    at Object.<anonymous> (viewDirective.js:310)
    at angular.js:1388 "<ui-view name="mainContent" portalview="[object Object]" class="ng-scope">"

alon24 avatar Oct 18 '19 18:10 alon24