score:13

Use refs.

First, hook-up a ref attribute on each of your JSX cols element. Then, use this ref, inside the componentDidMount method, to access the component's DOM node (the actual HTMLElement). Finally, get element's position / offset or anything else that you need.

const Col = React.createClass({
    componentDidMount: function() {
        // this.refs.col1 is the actual DOM element,
        // so you can access it's position / offset or whatever
        const offsetTop = this.refs.col1.offsetTop;
    },

    render() {
        return (
            <div className="col" ref="col1">
            </div>
        );
    }
});

PS: I am not sure what do you mean by saying element y position. Anyways, once you know how to get the DOM element (this.refs.col1), you can then use javascript to retrieve the position you need.


Related Query

More Query from same tag