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

Usage in Readme.md #51

Open
pa-do opened this issue Jan 25, 2021 · 4 comments
Open

Usage in Readme.md #51

pa-do opened this issue Jan 25, 2021 · 4 comments

Comments

@pa-do
Copy link

pa-do commented Jan 25, 2021

I found an error while executing an usage of a README.md. And I found what the problem is. It would be helpful to reflect this in the document.

import React, {Component} from 'react';
import { ScrollSync, ScrollSyncPane } from 'react-scroll-sync';

export default class MyComponent extends Component {
    render() {
    return (
        <ScrollSync>
        <div style={{ display: 'flex', position: 'relative', height: 300 }}>
          <ScrollSyncPane>
            <div style={{overflow: 'auto'}}>
              <section style={{ height: 500 }}>
                <h1>Left Pane Content</h1>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aperiam doloribus
                  dolorum
                  est eum eveniet exercitationem iste labore minus, neque nobis odit officiis omnis
                  possimus quasi rerum sed soluta veritatis.</p>
              </section>
            </div>
          </ScrollSyncPane>
      
          <ScrollSyncPane>
            <div style={{overflow: 'auto'}}>
              <section style={{ height: 1000 }}>
                <h1>Middle Pane Content</h1>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aperiam doloribus
                  dolorum
                  est eum eveniet exercitationem iste labore minus, neque nobis odit officiis omnis
                  possimus quasi rerum sed soluta veritatis.</p>
              </section>
            </div>
          </ScrollSyncPane>
      
          <ScrollSyncPane>
            <div style={{overflow: 'auto'}}>
              <section style={{ height: 2000 }}>
                <h1>Right Pane Content</h1>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aperiam doloribus
                  dolorum
                  est eum eveniet exercitationem iste labore minus, neque nobis odit officiis omnis
                  possimus quasi rerum sed soluta veritatis.</p>
              </section>
            </div>
          </ScrollSyncPane>
        </div>
      </ScrollSync>
    )}
}

Return was missing, and it works normally when added return ( to the line 6.

@okonet
Copy link
Owner

okonet commented Jan 25, 2021

Please send me a PR

@pa-do
Copy link
Author

pa-do commented Jan 25, 2021

This is my First PR for open source! I did it just few minutes before, so I close this issue!

Closes #52

@pa-do pa-do closed this as completed Jan 25, 2021
@okonet okonet reopened this Jan 25, 2021
@okonet
Copy link
Owner

okonet commented Jan 25, 2021

Thanks for working on it. Instead of closing it here please refer to it in the PR and it will be closed when it gets merged.

Closes #xxx like this but with the proper issue number please.

@pa-do
Copy link
Author

pa-do commented Jan 25, 2021

I got it. Thank you.

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