Skip to content

moving OutPortal doesn't cause unmount/mount, but *does* cause re-render #33

Description

@HenrikBechmann

is that normal?

    return <div ref = { shellRef } data-type = 'cellshell' data-scrollerid = {scrollerID} data-index = {index} data-instanceid = {instanceID} style = {styles}>
            { ((cellStatus == 'render') || (cellStatus == 'renderplaceholder')) && <OutPortal node = {reverseportal} /> }
            { (cellStatus == 'render1') && <OutPortal node = {reverseportal} /> }
        </div>

Both 'render' and 'render1' cause rendering of InPortal content (the console message is logged each time):

const GenericItem = (props) => {
    const [genericstate, setGenericState] = useState('setup')
    useEffect(()=>{
        if (genericstate == 'setup') {
            setGenericState('final')
        } 
    },[genericstate])
    console.log('rendering generic item index, genericstate',props.index,genericstate)
    return <div style = {{position:'relative',height:'100%', width:'100%',backgroundColor:'white'}}>
        <div style = {genericstyle}>
            {props.index + 1}{false && <img style= {{height:'100%'}} src={props.image}/>}
        </div>
    </div>
}

... but state ('final') is preserved

I was hoping that the move wouldn't trigger a render at all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions