GithubHelp home page GithubHelp logo

Comments (5)

lloydh avatar lloydh commented on July 24, 2024 8

I was seeing the same error but Nathan's commit did the trick.

from react-codemod.

bvaughn avatar bvaughn commented on July 24, 2024 1

Hey @kentcdodds! Sorry for not seeing this issue earlier. Have had my hands full the past few days.

I committed a few bug fixes this evening that should resolve the issues you reported above. (I ran the code snippets you provided to make certain.)

One thing to note: In your second example, the codemod will insert semicolons after the react and prop-types imports. (Sorry!)

from react-codemod.

kentcdodds avatar kentcdodds commented on July 24, 2024

Note that I did get errors for files that do actually utilize PropTypes (like this one):

import React, { PropTypes } from 'react'
import { StyleSheet, css } from 'aphrodite'
import * as ViewActions from '../../actions/actions'

import content from '../../lib/content'
const i18n = content('crossBorder/calc')

// Allows User to skip straight to Xoom if they want to repeat the
// prior Xoom transaction
const styles = StyleSheet.create({
	skipContainer: {
		lineHeight: '60px',
		marginBottom: 30,
		borderRadius: 5,
		backgroundColor: '#f5f7fa',
		fontSize: 15,
	},
})
const SkipToXoom = React.createClass({
	propTypes: {
		dispatch: PropTypes.func.isRequired,
		toCountryData: PropTypes.shape({
			countryName: PropTypes.string.isRequired, // localized country name
			countryCode: PropTypes.string.isRequired,
		}),
	},
	redirectToXoom() {
		this.props.dispatch(ViewActions.redirectToXoom({
			type: 'repeatUser',
			countryCode: this.props.toCountryData.countryCode,
		}))
	},
	render() {
		const { toCountryData: { countryName } } = this.props
		return (
			<div className={css(styles.skipContainer)}>
				<span className="content">
					{i18n('skipToXoom.body', { country: <strong key={countryName}>{countryName}</strong> })}
				</span>
				{' '}
				<a
					href="#"
					onClick={this.redirectToXoom}
					data-pagename="main:consumer:p2p:transfer:xb:repeatSkipToXoom"
				>
					{i18n('skipToXoom.link')}
				</a>
			</div>
		)
	},
})

export default SkipToXoom

from react-codemod.

ericdfields avatar ericdfields commented on July 24, 2024

Still seeing this. Is it because my babel setup is in my webpack instead of babelrc?

from react-codemod.

kentcdodds avatar kentcdodds commented on July 24, 2024

Have had my hands full the past few days.

No worries. Understandable :)

I committed a few bug fixes this evening that should resolve the issues you reported above. (I ran the code snippets you provided to make certain.)

Great! Thanks!

One thing to note: In your second example, the codemod will insert semicolons after the react and prop-types imports. (Sorry!)

No worries! We can autofix that away!

from react-codemod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.