Skip to content

Commit

Permalink
move render value to default props destruction value
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajdova committed Feb 28, 2025
1 parent 92dd866 commit b6b1c58
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type CounterProps = {
};

function Counter(props: CounterProps) {
const { render, className, ...otherProps } = props;
const { render = <button type="button" />, className, ...otherProps } = props;
const [count, setCount] = React.useState(0);
const odd = count % 2 === 1;
const state = React.useMemo(() => ({ odd }), [odd]);

const { renderElement } = useRender({
render: render ?? <button type="button" />,
render: render,
state,
props: {
...otherProps,
Expand Down

0 comments on commit b6b1c58

Please sign in to comment.