Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first path and second path from render function unequal #426

Open
JJVvV opened this issue Aug 1, 2016 · 3 comments
Open

The first path and second path from render function unequal #426

JJVvV opened this issue Aug 1, 2016 · 3 comments

Comments

@JJVvV
Copy link

JJVvV commented Aug 1, 2016

let render = ({props, path, context, dispatch}) => {
    let {todo, destroy, change, state, completed} = props;

    let {editing} = context.state[path] || {};
    let onEdit = () => {
       //the path from first rendering is diffrent from second rendering.
        console.log(path);

        dispatch({type: 'state changed', path, data: {editing: !editing}});
    };
    return (
        <li onClick={onEdit} class={classname({completed, editing})}>
            <div class="view">
                <input class="toggle" type="checkbox" />
                <label>{todo.value}</label>
                <button class="destroy" onClick={destroy}></button>
            </div>
            <input class="edit" value={todo.value} onKeyUp={change} />
        </li>
    )
}

popo_2016-08-01 16-32-12

@JJVvV JJVvV changed the title Why the first path and second path from render function unequal ? the first path and second path from render function unequal Aug 1, 2016
@JJVvV JJVvV changed the title the first path and second path from render function unequal The first path and second path from render function unequal Aug 1, 2016
@todesignandconquer
Copy link

todesignandconquer commented Aug 9, 2016

I can confirm that this is an issue as well:

image
image

@JJVvV
Copy link
Author

JJVvV commented Aug 10, 2016

@todesignandconquer That problem disappeared when I got the latest version. Thanks.

@todesignandconquer
Copy link

@JJVvV I'm still having this issue and I've always been on 2.0-rc16. It's particularly an issue when I am rendering ta reusable component onto the page for a particular container that might appear multiple times. The path being unique per component instance is crucial to managing state of it, especially in combination with deku-stateful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants