dohooo / react-native-table-component

🌱Build table for react native
MIT License
733 stars 189 forks source link

Warning: Failed prop type: Invalid prop `textStyle` of type `array` supplied to `Cell`, expected `object`. at Cell #154

Open yagnesh97 opened 1 year ago

yagnesh97 commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-table-component@1.2.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-table-component/components/rows.js b/node_modules/react-native-table-component/components/rows.js
index 40cecc6..b096fe4 100644
--- a/node_modules/react-native-table-component/components/rows.js
+++ b/node_modules/react-native-table-component/components/rows.js
@@ -26,7 +26,8 @@ export class Row extends Component {
               width={wth}
               height={height}
               flex={flex}
-              textStyle={[cellTextStyle && cellTextStyle(item), textStyle]}
+              // textStyle={[cellTextStyle && cellTextStyle(item), textStyle]}
+              textStyle={{...(cellTextStyle ? cellTextStyle(item) : {}), ...textStyle}}
               {...props}
             />
           );

This issue body was partially generated by patch-package.

dohooo commented 1 year ago

Hey, I had rewrote it in typescript and I'll optimizing it in react-native-reanimated. react-native-reanimated-table 🌴

BTW these problems are solved.

YovanggaAnandhika commented 1 year ago

react-native-reanimated-table

the link repository is missing buddy ?

dohooo commented 1 year ago

react-native-reanimated-table

the link repository is missing buddy ?

I haven't published it to GitHub yet.