-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-listdata.js
More file actions
33 lines (30 loc) · 811 Bytes
/
Copy pathtest-listdata.js
File metadata and controls
33 lines (30 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const babel = require('@babel/core');
const plugin = require('./dist/index.js');
const code = `
import React from 'react';
import { View, Text } from 'react-native';
export const ListDataCardRow = () => {
return (
<View className="w-full flex-row justify-between px-[10px] py-0.5">
<View className="mt-[7px]">
<Text className="font-bold text-[12px] text-[#053362]">
Name
</Text>
</View>
<View className="mt-[8px]">
<Text className="text-[12px] text-[#053362]">NIK</Text>
</View>
</View>
);
};
`;
babel.transform(code, {
presets: ['@babel/preset-react'],
plugins: [[plugin, { trailingSpaces: true }]]
}, (err, result) => {
if (err) {
console.error(err);
} else {
console.log(result.code);
}
});