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

Improve instructions to integrate into a create-react-app app #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gnapse
Copy link

@gnapse gnapse commented Jun 14, 2017

  • Moves the generated asset files into src/ because you can't normally import from outside it.
  • Adds the import of the theme.css file, which is absolutely needed for this integration to work.
  • Minor couple of fixes.

These are based on my experience while trying to follow the instructions to integrate react-toolbox into a React app created with create-react-app. Especially the missing line importing the theme.css file was daunting for a few minutes, and almost made me quit and look for alternatives.

* Moves the generated asset files into `src/` because you can't normally import from outside it.
* Adds the import of the `theme.css` file, which is absolutely needed for this integration to work.
* Minor couple of fixes.
@dennistang
Copy link

Were you able to get it working with CRA 1.3.1 with the example code?

Specifically, this isn't working for me:

const App = ({ children }) => (  
   <ThemeProvider theme={theme}>
     {children}
   </ThemeProvider>
 );
 
 export default App;

It gives me the error: React.Children.only expected to receive a single React element child

@gnapse
Copy link
Author

gnapse commented Jul 9, 2017

At a glance I think that does not have to do with my changes. The error you mention above is due to ThemeProvider not supporting more than one child element. If children in your example is an array of more than one item (or probably if it is an array of a single element) ThemeProvider will complain.

@gnapse
Copy link
Author

gnapse commented Jan 27, 2018

Hello?

@hawkins
Copy link

hawkins commented May 6, 2018

Just made a new react app using CRA and toolbox, this PR had the only steps missing to make integration flawless today. Would love to see this merged 🙂

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

Successfully merging this pull request may close these issues.

None yet

3 participants