Skip to content

Commit f1ec03d

Browse files
committed
chore(rules): update component rules to include rendering control guidelines
1 parent 84a8111 commit f1ec03d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.cursor/rules/components-rules.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ description: Best practices for using canvas components in @gravity-ui/graph
33
globs:
44
alwaysApply: false
55
---
6-
76
# General Component Rules
87
- use `setState` instead direct setting new value via `this.state =`
98
- use `setProps` instead direct setting new value via `this.props =`
9+
- **Rendering Control:** To request a component re-render, call the `performRender()` method. Do **not** call the `render()` method directly. Calling `setProps` or `setState` automatically triggers a re-render, so you do **not** need to call `performRender()` after them.
1010
- use `Component.create(props)` method to creating a children component instead `new Component(props)`
1111
- for creating children component use only method `updateChildren`
1212
```typescript

0 commit comments

Comments
 (0)