Categories
Docker React

Create docker container in Code

remote-containers extension allows you to build and run a docker image of your source.

https://www.youtube.com/watch?v=KFyRLxiRKAc&t=309s

In the devcontainer.json file, add the following 2 lines:
  "forwardPorts": [3000],
  "postCreateCommand": "npm install",

  "containerEnv": {
    "CHOKIDAR_USEPOLLING":"true"
  }
Build Container
F1
remote-containers rebuild and Reopen in containers
go to terminal and npm run start.  This will open the node app on port 3000 in a browser. 

This is definitely a work in progress. watch the video.

Categories
React

React Babel

When creating a quick react component in an html page, you will need to use babel to translate the jsx into something readable.

from :  https://reactjs.org/docs/cdn-links.html

and babel:

<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></scri
<!-- Load Babel -->
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
Categories
React

react foundation 6

Add these guys into your js component files to get the functionality of foundation:


import 'foundation-sites/dist/css/foundation.min.css'
import 'foundation-sites/dist/css/foundation-prototype.min.css'

// in the component itself,  use:
componentDidMount() {
$(document).foundation();
}