Skip to content

Commit 5cbbcae

Browse files
committed
fixed a bug in properties tab
1 parent 5b73a46 commit 5cbbcae

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/components/Props.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Props extends Component {
143143

144144
let { propKey, propValue, propRequired, propType } = this.state;
145145
propKey = propKey.replace(/\W+/gi, '');
146-
propValue = propKey.replace(/\W+/gi, '');
146+
propValue = propValue.replace(/\W+/gi, '');
147147

148148
// check if prop exists with same key. CANNOT have duplicates
149149
const savedPropKeys = this.props.focusComponent.props.map(p => p.key);

src/utils/componentRender.util.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ const componentRender = (component: ComponentInt, components: ComponentsInt) =>
136136
};
137137
138138
${classBased ? `class ${title} extends Component {` : `const ${title} = (props: Props) => {`}
139-
${
140-
stateful && !classBased
141-
? `const ['PROP', 'setPROP'] = useState("INITIAL VALUE FOR PROP");`
142-
: ``
143-
}
139+
${stateful && !classBased ? `const hey = useState(INITIAL VALUE FOR PROP);` : ``}
144140
${
145141
classBased && stateful
146142
? `constructor(props) {

0 commit comments

Comments
 (0)