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

Name for props of component prop use? #62

Open
interactivellama opened this issue Apr 28, 2017 · 0 comments
Open

Name for props of component prop use? #62

interactivellama opened this issue Apr 28, 2017 · 0 comments

Comments

@interactivellama
Copy link
Contributor

interactivellama commented Apr 28, 2017

I'm starting to use a pattern like this frequently. The reason being there are multiple date-pickers in Scheduler and if you use a component instead of just another object of props you get code completion, etc. and the consuming engineer doesn't need to go look the prop up on the doc site.

Maybe it's a type of HOC pattern, because typically the Datepicker component just gets discarded by Scheduler and the props are stolen. Any naming suggestions?

"Grandfather steals from grandprops" doesn't fly off the tongue that easily. 😄

<Scheduler
  datepickerSharedProps={<Datepicker
    assistiveText={{
      openCalendar: 'Open Calendar',
      nextMonth: 'Next month',
      previousMonth: 'Previous month'
    }}
    formatter={(date) => {
      let inputText = '';
      /* Make American or the Entire Rest of the World format here. */
      if (date) {
        inputText = `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;
      }
      return inputText;
    }}
  />}
/>

Maybe Child Component Proxy?

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

1 participant