nathansmith / unsemantic

Fluid grid for mobile, tablet, and desktop.
http://unsemantic.com
MIT License
1.38k stars 161 forks source link

updated depreciated react functions createClass and PropTypes #93

Closed theodore-q closed 6 years ago

theodore-q commented 7 years ago

Used the advised updates for React.createClass and React.PropTypes. I also Linted The whole thing. Now there is no javascript warning message and you will be able to use newer versions of react without issue.

nathansmith commented 7 years ago

Hmm. I use Standard JS linting, so the semi-colons actually would throw an error.

https://standardjs.com

I will incorporate the createClass changes at some point.

Thanks, I appreciate it.

coreyleelarson commented 6 years ago

Ah, I was just about to do this! Thank you!

It would be nice to have these changes made soon as I am trying to incorporate the react components in a React 16 project.

nathansmith commented 6 years ago

Sorry this took so long.

I just went ahead and made it ES6 class syntax, since that's what I am doing for the project I'm using it on now. I figure this is the ideal "React way" to do things now, and that CreateClass was just a stop-gap anyway.

I tagged it 1.2.0 to reflect the changes.

https://github.com/nathansmith/unsemantic/tree/1.2.0

coreyleelarson commented 6 years ago

Should these files be transpiled to ES5 prior to npm publish?

When building with Webpack/babel-loader, we exclude: /node_modules/ as most packages are already transpiled. If we don't use this, we get a slew of errors.

This is what I get when I import unsemantic:

import Grid from './assets/react/grid'
^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.unsemantic (/Users/nmcl54/Workspace/fairchild-watches/build/0.8c23de79e5b3b35345fb.hot-update.js:104:18)