From cb383df517dc5cd5b4d90136b533977a33611b71 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Mon, 25 Feb 2019 04:18:41 -0500
Subject: Fix bug to get wrapped component prop name list
---
src/hocs/with_load_more/with_load_more.js | 3 ++-
src/hocs/with_subscription/with_subscription.js | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
(limited to 'src/hocs')
diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.js
index a521014c..7d53e7ac 100644
--- a/src/hocs/with_load_more/with_load_more.js
+++ b/src/hocs/with_load_more/with_load_more.js
@@ -1,6 +1,7 @@
import Vue from 'vue'
import filter from 'lodash/filter'
import isEmpty from 'lodash/isEmpty'
+import { getComponentProps } from '../../services/component_utils/component_utils'
import './with_load_more.scss'
const withLoadMore = ({
@@ -9,7 +10,7 @@ const withLoadMore = ({
childPropName = 'entries', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => {
- const originalProps = WrappedComponent.props || []
+ const originalProps = Object.keys(getComponentProps(WrappedComponent))
const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames)
return Vue.component('withLoadMore', {
diff --git a/src/hocs/with_subscription/with_subscription.js b/src/hocs/with_subscription/with_subscription.js
index b6bc8358..4d3ae811 100644
--- a/src/hocs/with_subscription/with_subscription.js
+++ b/src/hocs/with_subscription/with_subscription.js
@@ -1,6 +1,7 @@
import Vue from 'vue'
import filter from 'lodash/filter'
import isEmpty from 'lodash/isEmpty'
+import { getComponentProps } from '../../services/component_utils/component_utils'
import './with_subscription.scss'
const withSubscription = ({
@@ -9,7 +10,7 @@ const withSubscription = ({
childPropName = 'content', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => {
- const originalProps = WrappedComponent.props || []
+ const originalProps = Object.keys(getComponentProps(WrappedComponent))
const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames)
return Vue.component('withSubscription', {
--
cgit v1.2.3-70-g09d2